1- From 34f648fd8855fe6e34b389a1577c9556431d6b5f Mon Sep 17 00:00:00 2001
1+ From 7c4266ee8332c71c3b29ca0d19821eb15195598a Mon Sep 17 00:00:00 2001
22From: Mika Laitio <lamikr@gmail.com>
3- Date: Fri, 26 Jan 2024 01:58:41 -0800
4- Subject: [PATCH 1/2 ] Support receiving ROCM_VERSION as a CMAKE parameter
3+ Date: Mon, 15 Jul 2024 17:09:38 -0400
4+ Subject: [PATCH] Support receiving ROCM_VERSION as a CMAKE parameter
55
66Signed-off-by: Mika Laitio <lamikr@gmail.com>
77---
8- CMakeLists.txt | 8 ++++++++
9- Makefile | 4 ++++
10- 2 files changed, 12 insertions(+)
8+ CMakeLists.txt | 8 ++++++++
9+ Makefile | 13 ++++++++-----
10+ 2 files changed, 16 insertions(+), 5 deletions(- )
1111
1212diff --git a/CMakeLists.txt b/CMakeLists.txt
13- index 7a0e7470c..dbb0d0782 100644
13+ index 0e37ceba5..651c5686c 100644
1414--- a/CMakeLists.txt
1515+++ b/CMakeLists.txt
1616@@ -11,6 +11,9 @@ else()
@@ -23,7 +23,7 @@ index 7a0e7470c..dbb0d0782 100644
2323
2424 # ----------------------------------------
2525 # to show compile commands, set this here or use 'make VERBOSE=1'
26- @@ -492 ,6 +495 ,11 @@ else()
26+ @@ -497 ,6 +500 ,11 @@ else()
2727 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-function" )
2828 endif()
2929
@@ -36,21 +36,32 @@ index 7a0e7470c..dbb0d0782 100644
3636 # Use rpaths, which is on by default in CMake 3.
3737 set( CMAKE_MACOSX_RPATH 1 )
3838diff --git a/Makefile b/Makefile
39- index a6b69c419..34ac52b62 100644
39+ index 5d7940aac..223f3bc99 100644
4040--- a/Makefile
4141+++ b/Makefile
42- @@ -842,7 +842,11 @@ d_ext := cu
42+ @@ -838,14 +838,17 @@ sparse/testing/clean:
43+
44+ # set the device extension
45+ ifeq ($(BACKEND),cuda)
46+ - d_ext := cu
47+ + d_ext := cu
4348 else ifeq ($(BACKEND),hip)
44- d_ext := cpp
45- CXXFLAGS += -D__HIP_PLATFORM_HCC__
46- + ifndef ROCM_VERSION
47- CXXFLAGS += -DROCM_VERSION=$(shell ./tools/get-rocm-version.sh)
48- + else
49- + CXXFLAGS += -DROCM_VERSION=$(ROCM_VERSION)
50- + endif
49+ - d_ext := cpp
50+ - CXXFLAGS += -D__HIP_PLATFORM_AMD__
51+ - CXXFLAGS += -DROCM_VERSION=$(shell ./tools/get-rocm-version.sh)
52+ + d_ext := cpp
53+ + CXXFLAGS += -D__HIP_PLATFORM_AMD__
54+ + ifndef ROCM_VERSION
55+ + CXXFLAGS += -DROCM_VERSION=$(shell ./tools/get-rocm-version.sh)
56+ + else
57+ + CXXFLAGS += -DROCM_VERSION=$(ROCM_VERSION)
58+ + endif
5159 endif
5260
61+ -
62+ ifeq ($(BACKEND),cuda)
5363
64+ %.i: %.$(d_ext) | $(CONFIG)
5465- -
55- 2.41.0
66+ 2.45.2
5667
0 commit comments