Skip to content

Compile-Time Warning: CUDA alignment conflict (#1886-D) in module_gint vbatch kernels during compilation #7212

Description

@AsTonyshment

Description

When compiling the latest develop branch with USE_CUDA=1, nvcc throws multiple #1886-D warnings related to shared memory alignment in the module_gint/kernel directory (e.g., gemm_nn_vbatch.cuh and gemm_tn_vbatch.cuh).

The compiler detects that the specified alignment (sizeof(float) = 4) differs from a previously specified alignment (sizeof(double) = 8) during the template instantiations of the shared memory array. While this does not seem to affect the successful compilation or the correctness of the program, it heavily clutters the compilation log.

Environment

  • Branch: develop (commit 3a996b6eb)
  • C++ Compiler: GNU 12.4.0
  • CUDA Toolkit: 12.1.66

Steps to Reproduce

  1. Configure the project with CUDA enabled:
    cmake -B build -DUSE_CUDA=1 -DENABLE_LIBXC=1 -DENABLE_LIBRI=1
  2. Start the compilation process.

Relevant Log Output

/source/source_lcao/module_gint/kernel/gemm_nn_vbatch.cuh(276): warning #1886-D: specified alignment (4) is different from alignment (8) specified on a previous declaration
      extern __attribute__((shared)) __attribute__((aligned(sizeof(T)))) unsigned char smem[];
                                                                         ^
          detected during:
            instantiation of "void vbatched_gemm_nn_kernel<T,DIM_X,DIM_Y,BLK_M,BLK_N,BLK_K,DIM_XA,DIM_YA,DIM_XB,DIM_YB>(const int *, const int *, const int *, const T *const *, const int *, const T *const *, const int *, T **, const int *, const T *) [with T=float, DIM_X=8, DIM_Y=4, BLK_M=16, BLK_N=16, BLK_K=8, DIM_XA=8, DIM_YA=4, DIM_XB=8, DIM_YB=4]" at line 424
            instantiation of "void vbatched_gemm_nn_impl<...>" at line 21 of /source/source_lcao/module_gint/kernel/dgemm_vbatch.cu

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions