You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
works fine when not setting an -std= flag when compiling (not sure what it uses then)
However when setting -std=c++17 or 20 this fails:
❯ clang++ basics2.cpp -lGL -lglfw -lepoxy -lOpenCL -pthread -std=c++17 -o a2-clang.out
In file included from basics2.cpp:14:
In file included from /usr/include/CL/opencl.hpp:574:
In file included from /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/functional:62:
In file included from /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/vector:64:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_vector.h:437:7: error: static_assert failed due to requirement 'is_same<int, float>::value' "std::vector must have the same value_type as its allocator"
static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
basics2.cpp:254:34: note: in instantiation of template class 'std::vector<float, cl::SVMAllocator<int, cl::SVMTraitCoarse<>>>' requested here
cl::coarse_svm_vector<float> p_vbocl(p_vbo_size, 0.0f, svmAllocFloat);
^
1 error generated.
3627 template < class T >
3628 using coarse_svm_vector = vector<T, cl::SVMAllocator<int, cl::SVMTraitCoarse<>>>;
I guess the hard coded int should be a T?
My system cant use the TraitFine SVM so can't test it for those, but from the definition it seems to have the same problem.
Also cl::coarse_svm_vector<int> test(10, 0.0f, svmAlloc);
just works (initializing an int array with floats?)
The text was updated successfully, but these errors were encountered:
ODON1
changed the title
Creaing a cl::coarse_svm_vector<> fails with all types except int on c++17 and 20
Creating a cl::coarse_svm_vector<> fails with all types except int on c++17 and 20
Dec 2, 2021
Trying to allocate a vector of floats:
works fine when not setting an -std= flag when compiling (not sure what it uses then)
However when setting -std=c++17 or 20 this fails:
Specifying manually works ok:
From the Definition at line 3628 of file cl2.hpp:
I guess the hard coded int should be a T?
My system cant use the TraitFine SVM so can't test it for those, but from the definition it seems to have the same problem.
Also
cl::coarse_svm_vector<int> test(10, 0.0f, svmAlloc);
just works (initializing an int array with floats?)
The text was updated successfully, but these errors were encountered: