gdb/testsuite/ChangeLog

2011-01-25  Ken Werner  <ken.werner@de.ibm.com>

        * gdb.opencl/convs_casts.cl: Move program scope variables into the
        OpenCL kernel function. Add a comment as marker. Add address space
        qualifiers for the remaining program scope variables.
        * gdb.opencl/datatypes.cl: Likewise.
        * gdb.opencl/operators.cl: Likewise.
        * gdb.opencl/vec_comps.cl: Likewise.
        * gdb.opencl/convs_casts.exp: Replace gdb_test_multiple by gdb_test.
        Add breakpoint at the marker comment.
        * gdb.opencl/datatypes.exp: Likewise.
        * gdb.opencl/operators.exp: Likewise.
        * gdb.opencl/vec_comps.exp: Likewise.
This commit is contained in:
Ken Werner
2011-01-25 16:10:28 +00:00
parent 29ec526351
commit d468832aa5
9 changed files with 286 additions and 248 deletions

View File

@ -1,3 +1,17 @@
2011-01-25 Ken Werner <ken.werner@de.ibm.com>
* gdb.opencl/convs_casts.cl: Move program scope variables into the
OpenCL kernel function. Add a comment as marker. Add address space
qualifiers for the remaining program scope variables.
* gdb.opencl/datatypes.cl: Likewise.
* gdb.opencl/operators.cl: Likewise.
* gdb.opencl/vec_comps.cl: Likewise.
* gdb.opencl/convs_casts.exp: Replace gdb_test_multiple by gdb_test.
Add breakpoint at the marker comment.
* gdb.opencl/datatypes.exp: Likewise.
* gdb.opencl/operators.exp: Likewise.
* gdb.opencl/vec_comps.exp: Likewise.
2011-01-24 Pedro Alves <pedro@codesourcery.com> 2011-01-24 Pedro Alves <pedro@codesourcery.com>
* gdb.base/printcmds.c (some_struct): New struct and instance. * gdb.base/printcmds.c (some_struct): New struct and instance.

View File

@ -17,22 +17,24 @@
Contributed by Ken Werner <ken.werner@de.ibm.com> */ Contributed by Ken Werner <ken.werner@de.ibm.com> */
int opencl_version = __OPENCL_VERSION__; __constant int opencl_version = __OPENCL_VERSION__;
#ifdef HAVE_cl_khr_fp64 #ifdef HAVE_cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable #pragma OPENCL EXTENSION cl_khr_fp64 : enable
int have_cl_khr_fp64 = 1; __constant int have_cl_khr_fp64 = 1;
#else #else
int have_cl_khr_fp64 = 0; __constant int have_cl_khr_fp64 = 0;
#endif #endif
#ifdef HAVE_cl_khr_fp16 #ifdef HAVE_cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable #pragma OPENCL EXTENSION cl_khr_fp16 : enable
int have_cl_khr_fp16 = 1; __constant int have_cl_khr_fp16 = 1;
#else #else
int have_cl_khr_fp16 = 0; __constant int have_cl_khr_fp16 = 0;
#endif #endif
__kernel void testkernel (__global int *data)
{
char c = 123; char c = 123;
uchar uc = 123; uchar uc = 123;
short s = 123; short s = 123;
@ -49,7 +51,7 @@ float f = 123.0;
double d = 123.0; double d = 123.0;
#endif #endif
__kernel void testkernel (__global int *data) /* marker! */
{
data[get_global_id(0)] = 1; data[get_global_id(0)] = 1;
} }

View File

@ -40,15 +40,19 @@ if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
clean_restart ${testfile} clean_restart ${testfile}
# Set breakpoint at the OpenCL kernel # Set breakpoint at the OpenCL kernel
gdb_test_multiple "break testkernel" "set pending breakpoint" { gdb_test "break testkernel" \
-re ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" { "" \
gdb_test "y" "Breakpoint.*testkernel.*pending." "set pending breakpoint (without symbols)" "Set pending breakpoint" \
} ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \
} "y"
gdb_run_cmd gdb_run_cmd
gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run"
# Continue to the marker
gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"]
gdb_continue_to_breakpoint "marker"
# Retrieve some information about availability of OpenCL extensions # Retrieve some information about availability of OpenCL extensions
set have_cl_khr_fp64 [get_integer_valueof "have_cl_khr_fp64" 0] set have_cl_khr_fp64 [get_integer_valueof "have_cl_khr_fp64" 0]
set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0] set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0]

View File

@ -17,22 +17,24 @@
Contributed by Ken Werner <ken.werner@de.ibm.com> */ Contributed by Ken Werner <ken.werner@de.ibm.com> */
int opencl_version = __OPENCL_VERSION__; __constant int opencl_version = __OPENCL_VERSION__;
#ifdef HAVE_cl_khr_fp64 #ifdef HAVE_cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable #pragma OPENCL EXTENSION cl_khr_fp64 : enable
int have_cl_khr_fp64 = 1; __constant int have_cl_khr_fp64 = 1;
#else #else
int have_cl_khr_fp64 = 0; __constant int have_cl_khr_fp64 = 0;
#endif #endif
#ifdef HAVE_cl_khr_fp16 #ifdef HAVE_cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable #pragma OPENCL EXTENSION cl_khr_fp16 : enable
int have_cl_khr_fp16 = 1; __constant int have_cl_khr_fp16 = 1;
#else #else
int have_cl_khr_fp16 = 0; __constant int have_cl_khr_fp16 = 0;
#endif #endif
__kernel void testkernel (__global int *data)
{
bool b = 0; bool b = 0;
char c = 1; char c = 1;
@ -139,7 +141,7 @@ double8 d8 = (double8) (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
double16 d16 = (double16)(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); double16 d16 = (double16)(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0);
#endif #endif
__kernel void testkernel (__global int *data) /* marker! */
{
data[get_global_id(0)] = 1; data[get_global_id(0)] = 1;
} }

View File

@ -206,15 +206,19 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${objdir}/${subdir}/${testfile} gdb_load ${objdir}/${subdir}/${testfile}
# Set breakpoint at the OpenCL kernel # Set breakpoint at the OpenCL kernel
gdb_test_multiple "break testkernel" "set pending breakpoint" { gdb_test "break testkernel" \
-re ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" { "" \
gdb_test "y" "Breakpoint.*testkernel.*pending." "set pending breakpoint (without symbols)" "Set pending breakpoint" \
} ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \
} "y"
gdb_run_cmd gdb_run_cmd
gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run"
# Continue to the marker
gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"]
gdb_continue_to_breakpoint "marker"
# Check if the language was switched to opencl # Check if the language was switched to opencl
gdb_test "show language" "The current source language is \"auto; currently opencl\"\." gdb_test "show language" "The current source language is \"auto; currently opencl\"\."

View File

@ -17,22 +17,24 @@
Contributed by Ken Werner <ken.werner@de.ibm.com> */ Contributed by Ken Werner <ken.werner@de.ibm.com> */
int opencl_version = __OPENCL_VERSION__; __constant int opencl_version = __OPENCL_VERSION__;
#ifdef HAVE_cl_khr_fp64 #ifdef HAVE_cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable #pragma OPENCL EXTENSION cl_khr_fp64 : enable
int have_cl_khr_fp64 = 1; __constant int have_cl_khr_fp64 = 1;
#else #else
int have_cl_khr_fp64 = 0; __constant int have_cl_khr_fp64 = 0;
#endif #endif
#ifdef HAVE_cl_khr_fp16 #ifdef HAVE_cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable #pragma OPENCL EXTENSION cl_khr_fp16 : enable
int have_cl_khr_fp16 = 1; __constant int have_cl_khr_fp16 = 1;
#else #else
int have_cl_khr_fp16 = 0; __constant int have_cl_khr_fp16 = 0;
#endif #endif
__kernel void testkernel (__global int *data)
{
char ca = 2; char ca = 2;
char cb = 1; char cb = 1;
uchar uca = 2; uchar uca = 2;
@ -99,7 +101,7 @@ float2 f2 = (float2) (1, 2);
double2 d2 = (double2) (1, 2); double2 d2 = (double2) (1, 2);
#endif #endif
__kernel void testkernel (__global int *data) /* marker! */
{
data[get_global_id(0)] = 1; data[get_global_id(0)] = 1;
} }

View File

@ -40,15 +40,19 @@ if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
clean_restart ${testfile} clean_restart ${testfile}
# Set breakpoint at the OpenCL kernel # Set breakpoint at the OpenCL kernel
gdb_test_multiple "break testkernel" "set pending breakpoint" { gdb_test "break testkernel" \
-re ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" { "" \
gdb_test "y" "Breakpoint.*testkernel.*pending." "set pending breakpoint (without symbols)" "Set pending breakpoint" \
} ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \
} "y"
gdb_run_cmd gdb_run_cmd
gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run"
# Continue to the marker
gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"]
gdb_continue_to_breakpoint "marker"
# Retrieve some information about availability of OpenCL extensions # Retrieve some information about availability of OpenCL extensions
set have_cl_khr_fp64 [get_integer_valueof "have_cl_khr_fp64" 0] set have_cl_khr_fp64 [get_integer_valueof "have_cl_khr_fp64" 0]
set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0] set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0]

View File

@ -17,22 +17,24 @@
Contributed by Ken Werner <ken.werner@de.ibm.com> */ Contributed by Ken Werner <ken.werner@de.ibm.com> */
int opencl_version = __OPENCL_VERSION__; __constant int opencl_version = __OPENCL_VERSION__;
#ifdef HAVE_cl_khr_fp64 #ifdef HAVE_cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable #pragma OPENCL EXTENSION cl_khr_fp64 : enable
int have_cl_khr_fp64 = 1; __constant int have_cl_khr_fp64 = 1;
#else #else
int have_cl_khr_fp64 = 0; __constant int have_cl_khr_fp64 = 0;
#endif #endif
#ifdef HAVE_cl_khr_fp16 #ifdef HAVE_cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable #pragma OPENCL EXTENSION cl_khr_fp16 : enable
int have_cl_khr_fp16 = 1; __constant int have_cl_khr_fp16 = 1;
#else #else
int have_cl_khr_fp16 = 0; __constant int have_cl_khr_fp16 = 0;
#endif #endif
__kernel void testkernel (__global int *data)
{
#define CREATE_VEC(TYPE, NAME)\ #define CREATE_VEC(TYPE, NAME)\
TYPE NAME =\ TYPE NAME =\
(TYPE) (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); (TYPE) (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
@ -53,7 +55,7 @@ CREATE_VEC(float16, f16)
CREATE_VEC(double16, d16) CREATE_VEC(double16, d16)
#endif #endif
__kernel void testkernel (__global int *data) /* marker! */
{
data[get_global_id(0)] = 1; data[get_global_id(0)] = 1;
} }

View File

@ -40,15 +40,19 @@ if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
clean_restart ${testfile} clean_restart ${testfile}
# Set breakpoint at the OpenCL kernel # Set breakpoint at the OpenCL kernel
gdb_test_multiple "break testkernel" "set pending breakpoint" { gdb_test "break testkernel" \
-re ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" { "" \
gdb_test "y" "Breakpoint.*testkernel.*pending." "set pending breakpoint (without symbols)" "Set pending breakpoint" \
} ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \
} "y"
gdb_run_cmd gdb_run_cmd
gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run" gdb_test "" ".*Breakpoint.*1.*testkernel.*" "run"
# Continue to the marker
gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"]
gdb_continue_to_breakpoint "marker"
# Check if the language was switched to opencl # Check if the language was switched to opencl
gdb_test "show language" "The current source language is \"auto; currently opencl\"\." gdb_test "show language" "The current source language is \"auto; currently opencl\"\."