ROCm / HIP-CPU

An implementation of HIP that works on CPUs, across OSes.
MIT License
107 stars 19 forks source link

Clang on Windows: 't' cannot be thread local when declared 'dllexport' #20

Closed MathiasMagnus closed 3 years ago

MathiasMagnus commented 3 years ago

Trying to use HIP-CPU on Windows using Clang results in a compiler error:

deps/hip-cpu/include\hip/../../src/include/hip/detail/runtime.hpp:180:55: error: 't' cannot be thread local when declared 'dllexport'
                static thread_local std::vector<Task> t;
                                                      ^

Note to "self": change hip/hip_defines.h from

#if defined(_WIN32)

to

#if defined(_WIN32) && (!defined(__clang__))

solves this issue. Likely a more sophisticated mechanism will be needed instead of this hotfix.

AlexVlx commented 3 years ago

Should be fixed by https://github.com/ROCm-Developer-Tools/HIP-CPU/commit/e98cd3cc09b212d58e5fd4afaeb6e70f74638ab3. Thank you for reporting it.