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
{{ message }}
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
I am trying to import <sycl/execution_policy> into my main.cpp file as well as a separate lib.cpp file, however I keep getting an internal SyclParallelSTL naming clash:
[ 80%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
liblib.a(lib.cpp.o):(.bss+0x0): multiple definition of `sycl::helpers::negative_distance'
CMakeFiles/main.dir/main.cpp.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:97: recipe for target 'main' failed
make[2]: *** [main] Error 1
CMakeFiles/Makefile2:100: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
The execution policy source code has a #ifndef __SYCL_EXECUTION_POLICY__ import guard, so I assume I can #include <sycl/execution_policy> in multiple files? The basic setup to reproduce the problem is below.
#include <sycl/execution_policy>
#include <experimental/algorithm>
void reduction() {
std::vector<int> v = {3, 1, 5, 6};
sycl::sycl_execution_policy<class reduce> par;
int result = std::experimental::parallel::reduce(par, v.begin(), v.end(), 0, [](int acc, int e) { return acc + e; });
std::cout << result << std::endl;
}
The corresponding problem can be found on this line. What I've tried is to add extern in front of the class definition, but that leads to negative_distance being undefined.
Any advice?
The text was updated successfully, but these errors were encountered:
I am trying to import
<sycl/execution_policy>
into my main.cpp file as well as a separate lib.cpp file, however I keep getting an internal SyclParallelSTL naming clash:The
execution policy
source code has a#ifndef __SYCL_EXECUTION_POLICY__
import guard, so I assume I can#include <sycl/execution_policy>
in multiple files? The basic setup to reproduce the problem is below.CMakeLists.txt:
main.cpp:
lib.cpp:
The corresponding problem can be found on this line. What I've tried is to add
extern
in front of the class definition, but that leads tonegative_distance
being undefined.Any advice?
The text was updated successfully, but these errors were encountered: