Add OmpSs-2 test with tasks

This commit is contained in:
Rodrigo Arias 2023-03-13 14:54:40 +01:00
parent 84623ea9d0
commit bf28263cc5
2 changed files with 47 additions and 0 deletions

View File

@ -327,6 +327,9 @@ let
compilers.clangOmpss2.lto = compilers.lto.override { compilers.clangOmpss2.lto = compilers.lto.override {
stdenv = bsc.stdenvClangOmpss2; stdenv = bsc.stdenvClangOmpss2;
}; };
compilers.clangOmpss2.task = callPackage ./test/compilers/ompss2.nix {
stdenv = bsc.stdenvClangOmpss2;
};
}; };
testAll = with bsc.test; [ testAll = with bsc.test; [
@ -336,6 +339,7 @@ let
compilers.intel2023.icc.cpp compilers.intel2023.icc.cpp
compilers.intel2023.ifort compilers.intel2023.ifort
compilers.clangOmpss2.lto compilers.clangOmpss2.lto
compilers.clangOmpss2.task
]; ];
ci = import ./test/ci.nix { ci = import ./test/ci.nix {

43
test/compilers/ompss2.nix Normal file
View File

@ -0,0 +1,43 @@
{ stdenv, writeText, which, strace }:
let
task_c = writeText "task.c" ''
#include <stdio.h>
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
'';
}