Skip to content

Instantly share code, notes, and snippets.

@M0nteCarl0
Created April 29, 2024 10:19
Show Gist options
  • Save M0nteCarl0/d2060a3608f1ae675124017814b221e2 to your computer and use it in GitHub Desktop.
Save M0nteCarl0/d2060a3608f1ae675124017814b221e2 to your computer and use it in GitHub Desktop.
Intel DPCPP library functions linkage for host code
void func();
int main() {
func();
return 0;
}
# 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
#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