Created
April 29, 2024 10:19
-
-
Save M0nteCarl0/d2060a3608f1ae675124017814b221e2 to your computer and use it in GitHub Desktop.
Intel DPCPP library functions linkage for host code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void func(); | |
int main() { | |
func(); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile | |
runG: sycl_lib.a | |
g++ -c main.cpp | |
dpcpp -o runG main.o sycl_lib.a -L$SYSL_DIR/lib -lsycl | |
./runG | |
sycl_lib.a: sycl_lib.cpp | |
dpcpp -c sycl_lib.cpp -fPIC | |
ar rvs sycl_lib.a sycl_lib.o | |
dpcpp -o runD main.cpp sycl_lib.a | |
./runD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<CL/sycl.hpp> | |
using namespace sycl; | |
void func() { | |
queue q; | |
q.submit([&](sycl::handler &h) { | |
sycl::stream os(1024, 768, h); | |
h.parallel_for(32, [=](sycl::id<1> i) { | |
os<<i<<"\n"; | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment