Add test for icpx with ompss-2 as host compiler
This commit is contained in:
		
							parent
							
								
									00ea3bb7a8
								
							
						
					
					
						commit
						b33be9fc8d
					
				| @ -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; }; | ||||
|  | ||||
							
								
								
									
										71
									
								
								test/compilers/icpx-ompss2.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								test/compilers/icpx-ompss2.nix
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,71 @@ | ||||
| { writeText, intelPackages, nodes, nosv, clangOmpss2Nodes, clangOmpss2Unwrapped, clangOmpss2, strace }: | ||||
| 
 | ||||
| let | ||||
|   hello_cpp = writeText "hello.cpp" '' | ||||
|     #include <cstdio> | ||||
|     #include <sycl/sycl.hpp> | ||||
| 
 | ||||
|     int main(int argc, char** argv) try { | ||||
|         sycl::queue queue; | ||||
| 
 | ||||
|         std::cout << "Running on: " | ||||
|                   << queue.get_device().get_info<sycl::info::device::name>() | ||||
|                   << std::endl; | ||||
| 
 | ||||
|         #pragma oss task | ||||
|         queue.submit([&] (sycl::handler& cgh) { | ||||
|             auto os = sycl::stream{128, 128, cgh}; | ||||
|             cgh.single_task<class hello_world>([=]() { | ||||
|                 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 -Wno-deprecated-declarations -fsycl \ | ||||
|         -fsycl-host-compiler=${clangOmpss2Nodes}/bin/clang++ \ | ||||
|         -fsycl-host-compiler-options='-Wno-deprecated-declarations -fompss-2=libnodes' \ | ||||
|         -lnodes -lnosv \ | ||||
|         $NODES_HOME/lib/nodes-main-wrapper.o \ | ||||
|         hello.cpp -o hello | ||||
| 
 | ||||
|     ./hello | ||||
|     set +x | ||||
|   ''; | ||||
| 
 | ||||
|   installPhase = '' | ||||
|     touch $out | ||||
|   ''; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user