forked from rarias/jungle
Add test to run sycl applications with PoCL
This commit is contained in:
parent
54a583dcfa
commit
9991207323
@ -82,6 +82,9 @@ let
|
||||
hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
|
||||
hello-sycl = callPackage ./test/compilers/hello-sycl.nix { };
|
||||
hello-syclompss = callPackage ./test/compilers/icpx-ompss2.nix { };
|
||||
hello-sycl-pocl = (callPackage ./test/compilers/hello-sycl.nix { }).withPocl;
|
||||
hello-syclompss-pocl = (callPackage ./test/compilers/icpx-ompss2.nix { }).withPocl;
|
||||
|
||||
lto = callPackage ./test/compilers/lto.nix { };
|
||||
asan = callPackage ./test/compilers/asan.nix { };
|
||||
intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; };
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
intelPackages,
|
||||
writeText,
|
||||
strace,
|
||||
pocl,
|
||||
}:
|
||||
|
||||
let
|
||||
@ -35,10 +36,10 @@ let
|
||||
'';
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
version = "0.0.1";
|
||||
name = "hello-sycl";
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
stdenv
|
||||
strace
|
||||
];
|
||||
@ -52,11 +53,27 @@ stdenv.mkDerivation {
|
||||
echo CXX=$CXX
|
||||
command -v $CXX
|
||||
$CXX -fsycl hello.cpp -o hello
|
||||
./hello
|
||||
./hello | tee test-output
|
||||
set +x
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
cp test-output $out
|
||||
'';
|
||||
}
|
||||
|
||||
passthru.withPocl = finalAttrs.finalPackage.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pocl ];
|
||||
env = (old.env or { }) // {
|
||||
POCL_DEBUG = "error,warn";
|
||||
POCL_CACHE_DIR = "/build/pocl_cache";
|
||||
|
||||
# Make PoCL report Intel vendor id so oneapi SYCL works
|
||||
POCL_DRIVER_VERSION_OVERRIDE = "2024.18.6.0.02_160000";
|
||||
POCL_CPU_VENDOR_ID_OVERRIDE = 32902;
|
||||
};
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
grep "Hello World! (on device)" $out
|
||||
'';
|
||||
});
|
||||
})
|
||||
|
||||
@ -37,7 +37,7 @@ let
|
||||
'';
|
||||
in
|
||||
|
||||
intelPackages.stdenv.mkDerivation {
|
||||
intelPackages.stdenv.mkDerivation (finalAttrs: {
|
||||
version = "0.0.1";
|
||||
name = "hello-syclompss";
|
||||
|
||||
@ -47,17 +47,23 @@ intelPackages.stdenv.mkDerivation {
|
||||
strace
|
||||
nodes
|
||||
nosv
|
||||
pocl
|
||||
];
|
||||
|
||||
env = {
|
||||
POCL_DEBUG = "error,warn";
|
||||
POCL_CACHE_DIR = "/build/pocl_cache";
|
||||
passthru.withPocl = finalAttrs.finalPackage.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pocl ];
|
||||
env = (old.env or { }) // {
|
||||
POCL_DEBUG = "error,warn";
|
||||
POCL_CACHE_DIR = "/build/pocl_cache";
|
||||
|
||||
# Make PoCL report Intel vendor id so oneapi SYCL works
|
||||
POCL_DRIVER_VERSION_OVERRIDE = "2024.18.6.0.02_160000";
|
||||
POCL_CPU_VENDOR_ID_OVERRIDE = 32902;
|
||||
};
|
||||
# Make PoCL report Intel vendor id so oneapi SYCL works
|
||||
POCL_DRIVER_VERSION_OVERRIDE = "2024.18.6.0.02_160000";
|
||||
POCL_CPU_VENDOR_ID_OVERRIDE = 32902;
|
||||
};
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
grep "Hello World! (on device)" $out
|
||||
'';
|
||||
});
|
||||
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
@ -82,11 +88,11 @@ intelPackages.stdenv.mkDerivation {
|
||||
$NODES_HOME/lib/nodes-main-wrapper.o \
|
||||
hello.cpp -o hello
|
||||
|
||||
./hello
|
||||
./hello | tee test-output
|
||||
set +x
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
cp test-output $out
|
||||
'';
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user