@@ -74,19 +74,32 @@ namespace hiprt
7474{
7575Compiler::Compiler ()
7676{
77- const std::string src =
78- " __global__ void rtcTest() { __builtin_amdgcn_image_bvh8_intersect_ray(0, 0.0f, 0xff, { 0.0f, 0.0f, 0.0f "
79- " }, { 1.0f, 0.0f, 0.0f }, 0, { 0, 0, 0, 0 }, nullptr, nullptr ); }" ;
77+ if ( UseBitcode || UseBakedCompiledKernel || hiprtcCreateProgram == nullptr || hiprtcCompileProgram == nullptr || hiprtcDestroyProgram == nullptr )
78+ {
79+ // If we use the precompiled bitcode, we won't check RTIP 3.1 support through HIPRTC.
80+ // Or, if the HIP Run Time Compiler is not loaded (e.g. hiprtc0604.dll) , we can't check RTIP 3.1 support.
81+
82+ // We'll assume it's supported, and Context::getRtip is supposed to make extra checks to be sure it's actually supported.
83+ m_rtip31Support = true ;
84+ }
85+ else
86+ {
87+ // check the RTIP 3.1 support of the RTC
8088
81- orortcProgram prog;
82- checkOrortc ( orortcCreateProgram ( &prog, src.c_str (), " " , 0 , nullptr , nullptr ) );
89+ const std::string src =
90+ " __global__ void rtcTest() { __builtin_amdgcn_image_bvh8_intersect_ray(0, 0.0f, 0xff, { 0.0f, 0.0f, 0.0f "
91+ " }, { 1.0f, 0.0f, 0.0f }, 0, { 0, 0, 0, 0 }, nullptr, nullptr ); }" ;
8392
84- m_rtip31Support = false ;
93+ orortcProgram prog;
94+ checkOrortc ( orortcCreateProgram ( &prog, src.c_str (), " " , 0 , nullptr , nullptr ) );
8595
86- if ( orortcCompileProgram ( prog, 0 , nullptr ) == ORORTC_SUCCESS )
87- {
88- m_rtip31Support = true ;
89- checkOrortc ( orortcDestroyProgram ( &prog ) );
96+ m_rtip31Support = false ;
97+
98+ if ( orortcCompileProgram ( prog, 0 , nullptr ) == ORORTC_SUCCESS )
99+ {
100+ m_rtip31Support = true ;
101+ checkOrortc ( orortcDestroyProgram ( &prog ) );
102+ }
90103 }
91104}
92105
0 commit comments