diff --git a/overlay.nix b/overlay.nix index e58498e..73cd830 100644 --- a/overlay.nix +++ b/overlay.nix @@ -62,6 +62,7 @@ in bscPkgs // { hello-c = callPackage ./test/compilers/hello-c.nix { }; hello-cpp = callPackage ./test/compilers/hello-cpp.nix { }; hello-sycl = callPackage ./test/compilers/hello-sycl.nix { }; + hello-syclompss = callPackage ./test/compilers/icpx-ompss2.nix { }; lto = callPackage ./test/compilers/lto.nix { }; asan = callPackage ./test/compilers/asan.nix { }; intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; }; diff --git a/test/compilers/icpx-ompss2.nix b/test/compilers/icpx-ompss2.nix new file mode 100644 index 0000000..0cb3c17 --- /dev/null +++ b/test/compilers/icpx-ompss2.nix @@ -0,0 +1,71 @@ +{ writeText, intelPackages, nodes, nosv, clangOmpss2Nodes, clangOmpss2Unwrapped, clangOmpss2, strace }: + +let + hello_cpp = writeText "hello.cpp" '' + #include + #include + + int main(int argc, char** argv) try { + sycl::queue queue; + + std::cout << "Running on: " + << queue.get_device().get_info() + << std::endl; + + #pragma oss task + queue.submit([&] (sycl::handler& cgh) { + auto os = sycl::stream{128, 128, cgh}; + cgh.single_task([=]() { + os << "Hello World! (on device)\n"; + }); + }).wait(); + + return 0; + } catch (sycl::exception &e) { + std::cout << "SYCL exception: " << e.what() << std::endl; + return 0; // we expect to fail since no devices should be available; + } + + ''; +in + +intelPackages.stdenv.mkDerivation { + version = "0.0.1"; + name = "hello-syclompss"; + + src = hello_cpp; + + nativeBuildInputs = [ + strace + nodes + nosv + ]; + + dontUnpack = true; + dontConfigure = true; + + env.NODES_HOME = nodes; + + NIX_DEBUG = 0; + buildPhase = '' + cp $src hello.cpp + set -x + echo CXX=$CXX + echo NODES_HOME=$NODES_HOME + command -v $CXX + + icpx -fsycl \ + -fsycl-host-compiler=${clangOmpss2Nodes}/bin/clang++ \ + -fsycl-host-compiler-options='-fompss-2=libnodes' \ + -lnodes -lnosv \ + $NODES_HOME/lib/nodes-main-wrapper.o \ + hello.cpp -o hello + + ./hello + set +x + ''; + + installPhase = '' + touch $out + ''; +}