Compare commits
4 Commits
f962816eab
...
3e0473d75e
Author | SHA1 | Date | |
---|---|---|---|
3e0473d75e | |||
ae59902fcc | |||
60a17565ea | |||
3f26a7e4fa |
@ -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; };
|
||||
|
@ -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
|
||||
|
||||
|
55
test/compilers/hello-sycl.nix
Normal file
55
test/compilers/hello-sycl.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user