unimplemented for this system in file for_each.h #3524
Replies: 5 comments
-
Okay, I've got a solution to the problem, but I can't say why it works... |
Beta Was this translation helpful? Give feedback.
-
Hi! My estimate is that the static library was compiled with a CUDA comiler, and the application with a non-CUDA compiler. Also, your "storage container class" may be declared in a header file that is included into the non-CUDA application. But it's hard to judge. Can you give us a sketch of your code please? |
Beta Was this translation helpful? Give feedback.
-
Hi Bernhard, thank-you for your input! Here is the link to the GitHub repo: Mila I've pushed a commit to help document the issue. The issue arises in the Tensor.ixx class which uses TensorBuffer.cuh. If you change the TensorBuffer to default to a VectorType of thrust::device_vector all executables which link to Mila get the compilation error. As background, I was quite interested in the llm.c repos, both the original Karpathy code and the Thrust port. I wanted to utilize both to have a general c++23 modules based port. I'd really like to use Thrust, but this issue is slowing me down. I'll soon just write my own storage class if I cannot figure out this issue. Thank-you in advance for any help. |
Beta Was this translation helpful? Give feedback.
-
I couldn't figure out how to use Thrust in a static library when attempting to use thrust::device_vector. It is too bad as I feel that Thrust is exactly the software I need. I will revisit this issue, but for now I've written my own memory resources derived from std::pmr::memory_resource. |
Beta Was this translation helpful? Give feedback.
-
Hi Bernhard, I'm hoping that you may be able to help me out. |
Beta Was this translation helpful? Give feedback.
-
I have a storage container class that essentially wraps a private
thrust::host_vector<T> buffer_;
The storage class is part of a static library. The library compiles without any issues.
When the static library is linked to an application and a compilation unit references the class containing the storage class I get a c2338 compile error with "unimplemented for this system" in file for_each.h. This occurs in the creation of the storage container class.
I've read the docs and I pretty certain that I need to set the Host and Device systems, but I can't figure it out. It seems the defaults are CPP and CUDA which is what I want.
If I replace the host_vector with a std::vector then the storage class is created without a compiler error.
It shouldn't matter but the static library uses C++23 modules.
Thanks in advance for any help!
Beta Was this translation helpful? Give feedback.
All reactions