#include <hip/hip_runtime.h>
#include <unistd.h>
+#define CHECK(cmd) \
+ { \
+ hipError_t error = cmd; \
+ if (error != hipSuccess) \
+ { \
+ fprintf (stderr, "error: '%s'(%d) at %s:%d\n", \
+ hipGetErrorString (error), error, __FILE__, __LINE__); \
+ exit (EXIT_FAILURE); \
+ } \
+ }
+
__global__ static void
kernel1 ()
{}
kernel2<<<1, 1>>> ();
- hipDeviceSynchronize ();
+ CHECK (hipDeviceSynchronize ());
return 0;
}
#include <hip/hip_runtime.h>
+#define CHECK(cmd) \
+ { \
+ hipError_t error = cmd; \
+ if (error != hipSuccess) \
+ { \
+ fprintf (stderr, "error: '%s'(%d) at %s:%d\n", \
+ hipGetErrorString (error), error, __FILE__, __LINE__); \
+ exit (EXIT_FAILURE); \
+ } \
+ }
+
+
__device__ static void
break_here_execee ()
{}
main ()
{
kernel<<<1, 1>>> ();
- hipDeviceSynchronize ();
+ CHECK (hipDeviceSynchronize ());
return 0;
}
CHECK (hipSetDevice (dev_number));
kern<<<1, 1>>> ();
- hipDeviceSynchronize ();
+ CHECK (hipDeviceSynchronize ());
return 0;
}
#include <hip/hip_runtime.h>
+#define CHECK(cmd) \
+ { \
+ hipError_t error = cmd; \
+ if (error != hipSuccess) \
+ { \
+ fprintf (stderr, "error: '%s'(%d) at %s:%d\n", \
+ hipGetErrorString (error), error, __FILE__, __LINE__); \
+ exit (EXIT_FAILURE); \
+ } \
+ }
+
__global__ void
kernel ()
{
main (int argc, char* argv[])
{
kernel<<<1, 1>>> ();
- hipDeviceSynchronize ();
+ CHECK (hipDeviceSynchronize ());
return 0;
}
#include <hip/hip_runtime.h>
+#define CHECK(cmd) \
+ { \
+ hipError_t error = cmd; \
+ if (error != hipSuccess) \
+ { \
+ fprintf (stderr, "error: '%s'(%d) at %s:%d\n", \
+ hipGetErrorString (error), error, __FILE__, __LINE__); \
+ exit (EXIT_FAILURE); \
+ } \
+ }
+
__global__ void
kernel ()
{
main (int argc, char* argv[])
{
kernel<<<1, 1>>> ();
- hipDeviceSynchronize ();
+ CHECK (hipDeviceSynchronize ());
return 0;
}
main ()
{
kern<<<1, 1>>> ();
- hipDeviceSynchronize ();
+ if (hipDeviceSynchronize () != hipSuccess)
+ return -1;
return 0;
}
} executable $flags]} {