Compare commits

...

4 Commits

Author SHA1 Message Date
3e0473d75e
fix gcc icc 2025-04-11 15:17:55 +02:00
ae59902fcc
Add SYCL test compilation 2025-04-11 15:06:11 +02:00
60a17565ea
Add alias intelPackages -> intelPackages_2023 2025-04-11 15:02:27 +02:00
3f26a7e4fa
Fix sycl intel-oneapi-compiler 2025-03-18 18:19:48 +01:00
3 changed files with 72 additions and 3 deletions

View File

@ -20,6 +20,7 @@ let
#extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
intelPackages = final.intelPackages_2023;
jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { };
#lmbench = callPackage ./pkgs/lmbench/default.nix { }; # Broken
mcxx = callPackage ./pkgs/mcxx/default.nix { };
@ -60,6 +61,7 @@ in bscPkgs // {
#sigsegv = callPackage ./test/reproducers/sigsegv.nix { };
hello-c = callPackage ./test/compilers/hello-c.nix { };
hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
hello-sycl = callPackage ./test/compilers/hello-sycl.nix { };
lto = callPackage ./test/compilers/lto.nix { };
asan = callPackage ./test/compilers/asan.nix { };
intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; };

View File

@ -313,6 +313,9 @@ let
"intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-common-${version}"
"intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-runtime-${version}"
"intel-oneapi-compiler-dpcpp-cpp-classic-fortran-shared-runtime-${version}"
"intel-oneapi-compiler-shared-${version}"
"intel-oneapi-compiler-shared-common-${version}"
"intel-oneapi-compiler-shared-runtime-${version}"
];
# From https://aur.archlinux.org/packages/intel-oneapi-compiler:
# - intel-oneapi-compiler-cpp-eclipse-cfg-2023.0.0-25370_all.deb
@ -329,9 +332,9 @@ let
# - intel-oneapi-compiler-fortran-common-2023.0.0-2023.0.0-25370_all.deb
# - intel-oneapi-compiler-fortran-runtime-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-compiler-fortran-runtime-2023.0.0-25370_amd64.deb
# - intel-oneapi-compiler-shared-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-compiler-shared-common-2023.0.0-2023.0.0-25370_all.deb
# - intel-oneapi-compiler-shared-runtime-2023.0.0-2023.0.0-25370_amd64.deb
# + intel-oneapi-compiler-shared-2023.0.0-2023.0.0-25370_amd64.deb
# + intel-oneapi-compiler-shared-common-2023.0.0-2023.0.0-25370_all.deb
# + intel-oneapi-compiler-shared-runtime-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-dpcpp-cpp-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-openmp-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-openmp-common-2023.0.0-2023.0.0-25370_all.deb
@ -398,6 +401,15 @@ let
echo "-L${intel-compiler-shared}/lib" >> $out/nix-support/cc-ldflags
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
echo "--gcc-toolchain=${mygcc.cc}" >> $out/nix-support/libcxx-cxxflags
for dir in ${mygcc.cc}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
for dir in ${mygcc.cc}/include/c++/*/${targetConfig}; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
# Need the gcc in the path
echo 'export "PATH=${mygcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook

View File

@ -0,0 +1,55 @@
{ intelPackages, writeText, strace }:
let
stdenv = intelPackages.stdenv;
hello_sycl = writeText "hello.cpp" ''
#include <sycl/sycl.hpp>
class hello_world;
int main(int argc, char** argv) try {
auto device_selector = sycl::default_selector_v;
sycl::queue queue(device_selector);
std::cout << "Running on: "
<< queue.get_device().get_info<sycl::info::device::name>()
<< std::endl;
queue.submit([&] (sycl::handler& cgh) {
auto os = sycl::stream{128, 128, cgh};
cgh.single_task<hello_world>([=]() {
os << "Hello World! (on device)\n";
});
});
return 0;
} catch (sycl::exception &e) {
std::cout << "SYCL exception: " << e.what() << std::endl;
return 0; // we excpect to fail since no devices should be available;
}
'';
in
stdenv.mkDerivation {
version = "0.0.1";
name = "hello-sycl";
buildInputs = [ stdenv strace ];
src = hello_sycl;
dontUnpack = true;
dontConfigure = true;
NIX_DEBUG = 0;
buildPhase = ''
cp $src hello.cpp
set -x
echo CXX=$CXX
command -v $CXX
$CXX -fsycl hello.cpp -o hello
./hello
set +x
'';
installPhase = ''
touch $out
'';
}