Skip to content

Commit 7ceee3b

Browse files
committed
Unit test - fix precomp OS flag
1 parent 592a92b commit 7ceee3b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/bitcodes/precompile_bitcode.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,20 @@ def compileAmd():
110110

111111
# compile hiprt traversal code
112112
hiprt_lib = hiprtlibpath + 'hiprt' + hiprt_ver + '_' + hip_version + '_amd_lib' + postfix
113-
113+
114+
if isLinux():
115+
osDef = "-DHIPCC_OS_LINUX"
116+
else:
117+
osDef = "-DHIPCC_OS_WINDOWS"
114118

115119
# compile custom function table
116120
hiprt_custom_func = 'hiprt' + hiprt_ver + '_' + hip_version + '_custom_func_table.bc'
117-
cmd = hipccpath + ' -O3 -std=c++17 ' + targets + ' -fgpu-rdc -c --gpu-bundle-output -c -emit-llvm -I../../ -ffast-math ../../test/bitcodes/custom_func_table.cpp -parallel-jobs=15 -o ' + hiprt_custom_func
121+
cmd = hipccpath + ' -O3 -std=c++17 ' + targets + ' -fgpu-rdc -c --gpu-bundle-output -c -emit-llvm -I../../ ' + osDef + ' -ffast-math ../../test/bitcodes/custom_func_table.cpp -parallel-jobs=15 -o ' + hiprt_custom_func
118122
compileScript('compiling ', cmd, hiprt_custom_func)
119123

120124
# compiling unit test
121125
hiprt_unit_test = 'hiprt' + hiprt_ver + '_' + hip_version + '_unit_test'+ postfix
122-
cmd = hipccpath + ' -O3 -std=c++17 ' + targets + ' -fgpu-rdc -c --gpu-bundle-output -c -emit-llvm -I../../ -ffast-math -D BLOCK_SIZE=64 -D SHARED_STACK_SIZE=16 ../../test/bitcodes/unit_test.cpp -parallel-jobs=15 -o ' + hiprt_unit_test
126+
cmd = hipccpath + ' -O3 -std=c++17 ' + targets + ' -fgpu-rdc -c --gpu-bundle-output -c -emit-llvm -I../../ ' + osDef + ' -ffast-math -D BLOCK_SIZE=64 -D SHARED_STACK_SIZE=16 ../../test/bitcodes/unit_test.cpp -parallel-jobs=15 -o ' + hiprt_unit_test
123127
compileScript('compiling ', cmd, hiprt_unit_test)
124128

125129
# linking

0 commit comments

Comments
 (0)