diff --git a/overlay.nix b/overlay.nix index ccbf4d5..f38b062 100644 --- a/overlay.nix +++ b/overlay.nix @@ -327,6 +327,9 @@ let compilers.clangOmpss2.lto = compilers.lto.override { stdenv = bsc.stdenvClangOmpss2; }; + compilers.clangOmpss2.task = callPackage ./test/compilers/ompss2.nix { + stdenv = bsc.stdenvClangOmpss2; + }; }; testAll = with bsc.test; [ @@ -336,6 +339,7 @@ let compilers.intel2023.icc.cpp compilers.intel2023.ifort compilers.clangOmpss2.lto + compilers.clangOmpss2.task ]; ci = import ./test/ci.nix { diff --git a/test/compilers/ompss2.nix b/test/compilers/ompss2.nix new file mode 100644 index 0000000..3127ac5 --- /dev/null +++ b/test/compilers/ompss2.nix @@ -0,0 +1,43 @@ +{ stdenv, writeText, which, strace }: + +let + task_c = writeText "task.c" '' + #include + + int main() + { + for (int i = 0; i < 10; i++) { + #pragma oss task + printf("Hello world!\n"); + } + + return 0; + } + ''; +in + +stdenv.mkDerivation rec { + version = "0.0.1"; + name = "task_c"; + src = task_c; + dontUnpack = true; + dontConfigure = true; + hardeningDisable = [ "all" ]; + NIX_DEBUG = 1; + buildPhase = '' + set -x + echo CC=$CC + $CC -v + + cp ${task_c} task.c + cat task.c + $CC -v -fompss-2 task.c -o task + ./task + + set +x + ''; + + installPhase = '' + touch $out + ''; +}