summaryrefslogtreecommitdiff
path: root/modules/sycl/.nix/derivation.nix
blob: b937ceae2e4f81de9f4721704d6183d34d2418d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, stdenv
, scons
, clang-tools
, pname
, version
, forstio
, kel
, adaptive-cpp
# Names the build so the host, ROCm and CUDA variants land in distinct outputs.
, variant ? ""
}:

stdenv.mkDerivation {
	pname = "${pname}-sycl${variant}";
	inherit version;
	src = ./..;

	nativeBuildInputs = [
		scons
		clang-tools
	];

	buildInputs = [
		forstio.core
		forstio.async
		forstio.codec
		forstio.codec-unit
		forstio.codec-json
		forstio.remote
		#forstio.remote-sycl
		kel.lbm.core
		adaptive-cpp
	];

	doCheck = true;
	checkPhase = ''
		# AdaptiveCpp caches JIT output under $HOME, which is /homeless-shelter
		# in a nix build. Point it somewhere writable or the tests die before
		# running a single case.
		export HOME="$TMPDIR"

		scons test
		./bin/tests
	'';

	preferLocalBuild = true;

	outputs = [ "out" "dev" ];
}