diff options
Diffstat (limited to 'gdb/testsuite/gdb.rocm')
5 files changed, 50 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu-execer.cpp b/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu-execer.cpp index 1a731ae..e42c8f1 100644 --- a/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu-execer.cpp +++ b/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu-execer.cpp @@ -18,6 +18,17 @@ #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 () {} @@ -50,6 +61,6 @@ main () kernel2<<<1, 1>>> (); - hipDeviceSynchronize (); + CHECK (hipDeviceSynchronize ()); return 0; } diff --git a/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execee.cpp b/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execee.cpp index 2de8fe2..cffeedb 100644 --- a/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execee.cpp +++ b/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execee.cpp @@ -17,6 +17,18 @@ #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 () {} @@ -31,6 +43,6 @@ int main () { kernel<<<1, 1>>> (); - hipDeviceSynchronize (); + CHECK (hipDeviceSynchronize ()); return 0; } diff --git a/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp b/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp index d64afdd..4ba406f 100644 --- a/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp +++ b/gdb/testsuite/gdb.rocm/multi-inferior-gpu.cpp @@ -95,7 +95,7 @@ child (int argc, char **argv) CHECK (hipSetDevice (dev_number)); kern<<<1, 1>>> (); - hipDeviceSynchronize (); + CHECK (hipDeviceSynchronize ()); return 0; } diff --git a/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.cpp b/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.cpp index bf1451a..d8ea869 100644 --- a/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.cpp +++ b/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.cpp @@ -17,6 +17,17 @@ #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 () { @@ -28,6 +39,6 @@ int main (int argc, char* argv[]) { kernel<<<1, 1>>> (); - hipDeviceSynchronize (); + CHECK (hipDeviceSynchronize ()); return 0; } diff --git a/gdb/testsuite/gdb.rocm/precise-memory.cpp b/gdb/testsuite/gdb.rocm/precise-memory.cpp index 034f023..610f187 100644 --- a/gdb/testsuite/gdb.rocm/precise-memory.cpp +++ b/gdb/testsuite/gdb.rocm/precise-memory.cpp @@ -17,6 +17,17 @@ #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 () { @@ -27,6 +38,6 @@ int main (int argc, char* argv[]) { kernel<<<1, 1>>> (); - hipDeviceSynchronize (); + CHECK (hipDeviceSynchronize ()); return 0; } |