Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QST] Errors about using CUTLASS within other applications #1154

Closed
MoCHEN-WHU opened this issue Oct 23, 2023 · 1 comment
Closed

[QST] Errors about using CUTLASS within other applications #1154

MoCHEN-WHU opened this issue Oct 23, 2023 · 1 comment

Comments

@MoCHEN-WHU
Copy link

Hello, I am new to using cutlass and I am trying to use it within other applications as Using CUTLASS within other applications. I have created a directory called my_test which contains my_test.cpp (the "print" example code) and CMakeLists.txt.

project(MY_TEST)

set(CMAKE_CXX_STANDARD 17)

add_executable(my_test my_test.cpp)

include_directories(
    /root/cutlass/include
    /root/cutlass/tools/util/include
    )

However, the compiler is unable to locate the CUDA include directory.

[ 50%] Building CXX object CMakeFiles/my_test.dir/my_test.cpp.o
In file included from /root/cutlass/include/cutlass/numeric_types.h:77,
                 from /root/cutlass/my_test/my_test.cpp:3:
/root/cutlass/include/cutlass/half.h:73:10: fatal error: cuda_fp16.h: No such file or directory
   73 | #include <cuda_fp16.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

I try to add it explicitly as

include_directories(
    /usr/local/cuda/include
    /root/cutlass/include
    /root/cutlass/tools/util/include
    )

Then the errors happen in platform.h

[ 50%] Building CXX object CMakeFiles/my_test.dir/my_test.cpp.o
In file included from /root/cutlass/include/cutlass/integer_subbyte.h:57,
                 from /root/cutlass/include/cutlass/numeric_types.h:75,
                 from /root/cutlass/my_test/my_test.cpp:3:
/root/cutlass/include/cutlass/platform/platform.h:683:21: error: 'int4' was not declared in this scope; did you mean 'int'?
  683 | struct alignment_of<int4> {
      |                     ^~~~
      |                     int
/root/cutlass/include/cutlass/platform/platform.h:683:25: error: template argument 1 is invalid
  683 | struct alignment_of<int4> {
      |                         ^
/root/cutlass/include/cutlass/platform/platform.h:687:21: error: 'uint4' was not declared in this scope; did you mean 'uint'?
  687 | struct alignment_of<uint4> {
      |                     ^~~~~
      |                     uint
/root/cutlass/include/cutlass/platform/platform.h:687:26: error: template argument 1 is invalid
  687 | struct alignment_of<uint4> {
      |                          ^
/root/cutlass/include/cutlass/platform/platform.h:691:21: error: 'float4' was not declared in this scope; did you mean 'float'?
  691 | struct alignment_of<float4> {
      |                     ^~~~~~
      |                     float
/root/cutlass/include/cutlass/platform/platform.h:691:27: error: template argument 1 is invalid
  691 | struct alignment_of<float4> {
      |                           ^
/root/cutlass/include/cutlass/platform/platform.h:695:21: error: 'long4' was not declared in this scope; did you mean 'long'?
  695 | struct alignment_of<long4> {
      |                     ^~~~~
      |                     long
/root/cutlass/include/cutlass/platform/platform.h:695:26: error: template argument 1 is invalid
  695 | struct alignment_of<long4> {
      |                          ^
/root/cutlass/include/cutlass/platform/platform.h:699:21: error: 'ulong4' was not declared in this scope; did you mean 'ulong'?
  699 | struct alignment_of<ulong4> {
      |                     ^~~~~~
      |                     ulong
/root/cutlass/include/cutlass/platform/platform.h:699:27: error: template argument 1 is invalid
  699 | struct alignment_of<ulong4> {
      |                           ^
/root/cutlass/include/cutlass/platform/platform.h:703:21: error: 'longlong2' was not declared in this scope
  703 | struct alignment_of<longlong2> {
      |                     ^~~~~~~~~
/root/cutlass/include/cutlass/platform/platform.h:703:30: error: template argument 1 is invalid
  703 | struct alignment_of<longlong2> {
      |                              ^
/root/cutlass/include/cutlass/platform/platform.h:707:21: error: 'ulonglong2' was not declared in this scope
  707 | struct alignment_of<ulonglong2> {
      |                     ^~~~~~~~~~
/root/cutlass/include/cutlass/platform/platform.h:707:31: error: template argument 1 is invalid
  707 | struct alignment_of<ulonglong2> {
      |                               ^
/root/cutlass/include/cutlass/platform/platform.h:711:21: error: 'double2' was not declared in this scope; did you mean 'double'?
  711 | struct alignment_of<double2> {
      |                     ^~~~~~~
      |                     double
/root/cutlass/include/cutlass/platform/platform.h:711:28: error: template argument 1 is invalid
  711 | struct alignment_of<double2> {
      |                            ^
/root/cutlass/include/cutlass/platform/platform.h:715:21: error: 'longlong4' was not declared in this scope
  715 | struct alignment_of<longlong4> {
      |                     ^~~~~~~~~
/root/cutlass/include/cutlass/platform/platform.h:715:30: error: template argument 1 is invalid
  715 | struct alignment_of<longlong4> {
      |                              ^
/root/cutlass/include/cutlass/platform/platform.h:719:21: error: 'ulonglong4' was not declared in this scope
  719 | struct alignment_of<ulonglong4> {
      |                     ^~~~~~~~~~
/root/cutlass/include/cutlass/platform/platform.h:719:31: error: template argument 1 is invalid
  719 | struct alignment_of<ulonglong4> {
      |                               ^
/root/cutlass/include/cutlass/platform/platform.h:723:21: error: 'double4' was not declared in this scope; did you mean 'double'?
  723 | struct alignment_of<double4> {
      |                     ^~~~~~~
      |                     double
/root/cutlass/include/cutlass/platform/platform.h:723:28: error: template argument 1 is invalid
  723 | struct alignment_of<double4> {
      |                            ^
In file included from /root/cutlass/my_test/my_test.cpp:4:
/root/cutlass/include/cutlass/core_io.h:63:52: error: 'dim3' has not been declared
   63 | inline std::ostream &operator<<(std::ostream &out, dim3 d) {
      |                                                    ^~~~
/root/cutlass/include/cutlass/core_io.h: In function 'std::ostream& operator<<(std::ostream&, int)':
/root/cutlass/include/cutlass/core_io.h:64:19: error: request for member 'x' in 'd', which is of non-class type 'int'
   64 |   return out << d.x << ", " << d.y << ", " << d.z;
      |                   ^
/root/cutlass/include/cutlass/core_io.h:64:34: error: request for member 'y' in 'd', which is of non-class type 'int'
   64 |   return out << d.x << ", " << d.y << ", " << d.z;
      |                                  ^
/root/cutlass/include/cutlass/core_io.h:64:49: error: request for member 'z' in 'd', which is of non-class type 'int'
   64 |   return out << d.x << ", " << d.y << ", " << d.z;
      |                                                 ^
/root/cutlass/include/cutlass/core_io.h: At global scope:
/root/cutlass/include/cutlass/core_io.h:68:52: error: 'cudaError_t' has not been declared
   68 | inline std::ostream &operator<<(std::ostream &out, cudaError_t error) {
      |                                                    ^~~~~~~~~~~
/root/cutlass/include/cutlass/core_io.h:68:22: error: redefinition of 'std::ostream& operator<<(std::ostream&, int)'
   68 | inline std::ostream &operator<<(std::ostream &out, cudaError_t error) {
      |                      ^~~~~~~~
/root/cutlass/include/cutlass/core_io.h:63:22: note: 'std::ostream& operator<<(std::ostream&, int)' previously defined here
   63 | inline std::ostream &operator<<(std::ostream &out, dim3 d) {
      |                      ^~~~~~~~
/root/cutlass/include/cutlass/core_io.h: In function 'std::ostream& operator<<(std::ostream&, int)':
/root/cutlass/include/cutlass/core_io.h:69:17: error: 'cudaGetErrorString' was not declared in this scope
   69 |   return out << cudaGetErrorString(error);
@MoCHEN-WHU MoCHEN-WHU changed the title [QST] Errors bout using CUTLASS within other applications [QST] Errors about using CUTLASS within other applications Oct 23, 2023
@MoCHEN-WHU
Copy link
Author

The file should be named *.cu instead of *.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant