File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ limitations under the License. */
17
17
#define STRINGIFY (x ) #x
18
18
#define TOSTRING (x ) STRINGIFY(x)
19
19
20
- #if defined(__APPLE__ ) && defined( __CUDA_ARCH__ ) && !defined( NDEBUG )
20
+ #if defined(__CUDA_ARCH__ )
21
21
#include <stdio.h>
22
22
#define PADDLE_ASSERT (e ) \
23
23
do { \
@@ -38,6 +38,9 @@ limitations under the License. */
38
38
} while (0)
39
39
#else
40
40
#include <assert.h>
41
- #define PADDLE_ASSERT (e ) assert(e)
41
+ // For cuda, the assertions can affect performance and it is therefore
42
+ // recommended to disable them in production code
43
+ // https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#assertion
44
+ #define PADDLE_ASSERT (e ) assert((e))
42
45
#define PADDLE_ASSERT_MSG (e , m ) assert((e) && (m))
43
46
#endif
You can’t perform that action at this time.
0 commit comments