10 , buildExamples ? false
11 , gpuTargets ? null # gpuTargets = [ "gfx803" "gfx900" "gfx1030" ... ]
14 assert buildTests -> gtest != null;
16 # Several tests seem to either not compile or have a race condition
17 # Undefined reference to symbol '_ZTIN7testing4TestE'
18 # Try removing this next update
19 assert buildTests == false;
21 stdenv.mkDerivation rec {
22 pname = "composable_kernel";
23 version = "unstable-2022-11-02";
27 ] ++ lib.optionals buildTests [
29 ] ++ lib.optionals buildExamples [
33 src = fetchFromGitHub {
34 owner = "ROCmSoftwarePlatform";
35 repo = "composable_kernel";
36 rev = "79aa3fb1793c265c59d392e916baa851a55521c8";
37 hash = "sha256-vIfMdvRYCTqrjMGSb7gQfodzLw2wf3tGoCAa5jtfbvw=";
48 ] ++ lib.optionals buildTests [
53 "-DCMAKE_C_COMPILER=hipcc"
54 "-DCMAKE_CXX_COMPILER=hipcc"
55 ] ++ lib.optionals (gpuTargets != null) [
56 "-DGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}"
59 # No flags to build selectively it seems...
61 substituteInPlace test/CMakeLists.txt \
62 --replace "include(googletest)" ""
64 substituteInPlace CMakeLists.txt \
65 --replace "enable_testing()" ""
66 '' + lib.optionalString (!buildTests) ''
67 substituteInPlace CMakeLists.txt \
68 --replace "add_subdirectory(test)" ""
69 '' + lib.optionalString (!buildExamples) ''
70 substituteInPlace CMakeLists.txt \
71 --replace "add_subdirectory(example)" ""
76 mv bin/ckProfiler $out/bin
77 '' + lib.optionalString buildTests ''
79 mv bin/test_* $test/bin
80 '' + lib.optionalString buildExamples ''
82 mv bin/example_* $example/bin
86 description = "Performance portable programming model for machine learning tensor operators";
87 homepage = "https://github.com/ROCmSoftwarePlatform/composable_kernel";
88 license = with licenses; [ mit ];
89 maintainers = with maintainers; [ Madouura ];