Skip to content

Commit c664824

Browse files
committed
more refinement for cuda
1 parent 4af1323 commit c664824

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/common/ShivaMacros.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ void shivaAssertionFailed(const char* file, int line, const char* fmt, ...)
111111
printf("Assertion failed [%s:%d]: ", file, line);
112112
printf(fmt);
113113
printf("\n");
114-
// #if defined(__CUDA_ARCH__)
115-
// __trap();
116-
// #elif defined(__HIP_DEVICE_COMPILE__)
117-
// __builtin_trap();
118-
// #endif
114+
#if defined(__CUDA_ARCH__)
115+
__trap();
116+
#elif defined(__HIP_DEVICE_COMPILE__)
117+
__builtin_trap();
118+
#endif
119119
#else // Host
120120
fprintf(stderr, "Assertion failed [%s:%d]: ", file, line);
121121
va_list args;

src/common/unitTests/testCArray.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ void testBoundsCheckParenthesesOperator1dHelper( int const ilower = 0,
289289
TEST( testCArray, testBoundsCheckParenthesesOperator1d )
290290
{
291291
testBoundsCheckParenthesesOperator1dHelper< 2 >();
292-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator1dHelper< 2 >( -1, -1 );}, "Index out of bounds:" );
293-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator1dHelper< 2 >( 2, 2 );}, "Index out of bounds:" );
292+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator1dHelper< 2 >( -1, -1 );}, "" );
293+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator1dHelper< 2 >( 2, 2 );}, "" );
294294
}
295295

296296
template< int DIM0 = 2, int DIM1 = 4 >
@@ -315,14 +315,14 @@ TEST( testCArray, testBoundsCheckParenthesesOperator2d )
315315
{
316316
testBoundsCheckParenthesesOperator2dHelper();
317317

318-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( -1, -1, 0, 3 );}, "Index out of bounds:" );
319-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 2, 2, 0, 3 );}, "Index out of bounds:" );
320-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 0, 1, -1, -1 );}, "Index out of bounds:" );
321-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 0, 1, 4, 4 );}, "Index out of bounds:" );
322-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( -1, -1, -1, -1 );}, "Index out of bounds:" );
323-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( -1, -1, 4, 4 );}, "Index out of bounds:" );
324-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 2, 2, -1, -1 );}, "Index out of bounds:" );
325-
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 2, 2, 4, 4 );}, "Index out of bounds:" );
318+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( -1, -1, 0, 3 );}, "" );
319+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 2, 2, 0, 3 );}, "" );
320+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 0, 1, -1, -1 );}, "" );
321+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 0, 1, 4, 4 );}, "" );
322+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( -1, -1, -1, -1 );}, "" );
323+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( -1, -1, 4, 4 );}, "" );
324+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 2, 2, -1, -1 );}, "" );
325+
EXPECT_DEATH( {testBoundsCheckParenthesesOperator2dHelper( 2, 2, 4, 4 );}, "" );
326326

327327
}
328328

@@ -344,8 +344,8 @@ TEST( testCArray, testSquareBracketOperator1D )
344344
{
345345
testSquareBracketOperator1DHelper();
346346

347-
EXPECT_DEATH( {testSquareBracketOperator1DHelper< 2 >( -1, -1 );}, "Index out of bounds:" );
348-
EXPECT_DEATH( {testSquareBracketOperator1DHelper< 2 >( 3, 3 );}, "Index out of bounds:" );
347+
EXPECT_DEATH( {testSquareBracketOperator1DHelper< 2 >( -1, -1 );}, "" );
348+
EXPECT_DEATH( {testSquareBracketOperator1DHelper< 2 >( 3, 3 );}, "" );
349349

350350
}
351351

0 commit comments

Comments
 (0)