Skip to content

Commit c511112

Browse files
authored
Fixes for Tioga Compiler Warnings (#297)
1 parent 145bb1c commit c511112

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

host-configs/LLNL/tioga-cce-15.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set(CMAKE_Fortran_COMPILER "/opt/cray/pe/craype/${CRAYPE_VERSION}/bin/ftn" CACHE
2727
if( ENABLE_HIP )
2828
set( ENABLE_CLANG_HIP ON CACHE BOOL "" FORCE )
2929

30-
set( HIP_VERSION_STRING "5.4.0" CACHE STRING "" )
30+
set( HIP_VERSION_STRING "5.4.3" CACHE STRING "" )
3131
set( HIP_ROOT "/opt/rocm-${HIP_VERSION_STRING}" CACHE PATH "" )
3232
set( ROCM_PATH ${HIP_ROOT} CACHE PATH "" )
3333

src/ChaiBuffer.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ class ChaiBuffer
183183
{
184184
#if defined(LVARRAY_DEVICE_COMPILE)
185185
LVARRAY_ERROR( "Creating a new ChaiBuffer on device is not supported." );
186+
LVARRAY_UNUSED_VARIABLE( spaces );
187+
LVARRAY_UNUSED_VARIABLE( allocators );
186188
#else
187189
m_pointerRecord->m_size = 0;
188190
setName( "" );
@@ -308,10 +310,15 @@ class ChaiBuffer
308310
* @note Although it is marked as a host-device method, this is only valid to call from the host.
309311
*/
310312
LVARRAY_HOST_DEVICE
311-
void reallocate( std::ptrdiff_t const size, MemorySpace const space, std::ptrdiff_t const newCapacity )
313+
void reallocate( std::ptrdiff_t const size,
314+
MemorySpace const space,
315+
std::ptrdiff_t const newCapacity )
312316
{
313317
#if defined(LVARRAY_DEVICE_COMPILE)
314318
LVARRAY_ERROR( "Allocation from device is not supported." );
319+
LVARRAY_UNUSED_VARIABLE( size );
320+
LVARRAY_UNUSED_VARIABLE( space );
321+
LVARRAY_UNUSED_VARIABLE( newCapacity );
315322
#else
316323
move( space, true );
317324
chai::PointerRecord * const newRecord = new chai::PointerRecord{};

src/Macros.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666
*/
6767
#define STRINGIZE( A ) STRINGIZE_NX( A )
6868

69-
//#pragma message "LVARRAY_DEVICE_COMPILE: " STRINGIZE(LVARRAY_DEVICE_COMPILE)
70-
7169
/**
7270
* @brief Mark @p X as an unused argument, used to silence compiler warnings.
7371
* @param X the unused argument.
@@ -123,7 +121,11 @@
123121
*/
124122

125123
#if defined(LVARRAY_DEVICE_COMPILE)
126-
#if !defined(NDEBUG) || __HIP_DEVICE_COMPILE__ == 1
124+
// #if defined(__HIP_DEVICE_COMPILE__)
125+
// // empty impl to avoid the possibility of printfs in device code
126+
// // on AMD, which can cause performance degradation just by being present
127+
// #define LVARRAY_ERROR_IF( EXP, MSG )
128+
#if (!defined(NDEBUG)) || defined(__HIP_DEVICE_COMPILE__)
127129
#define LVARRAY_ERROR_IF( EXP, MSG ) \
128130
do \
129131
{ \

0 commit comments

Comments
 (0)