romanr

OpenCL APP compiler bug c89 code

Discussion created by romanr on Jun 15, 2012
Latest reply on Jun 18, 2012 by kcarney

AMD-APP-SDK-v2.7

platform[0x7f3485d1c140]: CL_PLATFORM_PROFILE = FULL_PROFILE

platform[0x7f3485d1c140]: CL_PLATFORM_VERSION = OpenCL 1.2 AMD-APP (923.1)

platform[0x7f3485d1c140]: CL_PLATFORM_NAME = AMD Accelerated Parallel Processing

platform[0x7f3485d1c140]: CL_PLATFORM_VENDOR = Advanced Micro Devices, Inc.

platform[0x7f3485d1c140]: 1 devices: 0xe451a0

device[0xe451a0]: CL_DEVICE_TYPE = CL_DEVICE_TYPE_CPU

device[0xe451a0]: CL_DEVICE_VENDOR_ID = 4098

device[0xe451a0]: CL_DEVICE_MAX_COMPUTE_UNITS = 4

device[0xe451a0]: CL_DEVICE_ADDRESS_BITS = 64

device[0xe451a0]: CL_DEVICE_GLOBAL_MEM_SIZE = 4153659392

device[0xe451a0]: CL_DEVICE_ENDIAN_LITTLE = CL_TRUE

device[0xe451a0]: CL_DEVICE_AVAILABLE = CL_TRUE

device[0xe451a0]: CL_DEVICE_NAME = Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz

device[0xe451a0]: CL_DEVICE_VENDOR = GenuineIntel

device[0xe451a0]: CL_DRIVER_VERSION = 2.0 (sse2)

device[0xe451a0]: CL_DEVICE_PROFILE = FULL_PROFILE

device[0xe451a0]: CL_DEVICE_VERSION = OpenCL 1.2 AMD-APP (923.1)

device[0xe451a0]: CL_DEVICE_OPENCL_C_VERSION = OpenCL C 1.2

 

Sample program text is attached.

 

Compiler output (stdout):

UNREACHABLE executed!

 

Stacktrace:

#0  0x00007ffff786c3a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64

#1  0x00007ffff786fb0b in __GI_abort () at abort.c:92

#2  0x00007ffff6beb0a0 in ?? () from /opt/amd/lib64/libamdocl64.so

#3  0x00007ffff626bf69 in ?? () from /opt/amd/lib64/libamdocl64.so

#4  0x00007ffff667cb50 in ?? () from /opt/amd/lib64/libamdocl64.so

#5  0x00007ffff667cc90 in ?? () from /opt/amd/lib64/libamdocl64.so

#6  0x00007ffff668d5cf in ?? () from /opt/amd/lib64/libamdocl64.so

#7  0x00007ffff6b86630 in ?? () from /opt/amd/lib64/libamdocl64.so

#8  0x00007ffff6b86742 in ?? () from /opt/amd/lib64/libamdocl64.so

#9  0x00007ffff6b868d9 in ?? () from /opt/amd/lib64/libamdocl64.so

#10 0x00007ffff5e2c812 in ?? () from /opt/amd/lib64/libamdocl64.so

#11 0x00007ffff5e30e18 in ?? () from /opt/amd/lib64/libamdocl64.so

#12 0x00007ffff5e5a64f in ?? () from /opt/amd/lib64/libamdocl64.so

#13 0x00007ffff5e5cf9b in ?? () from /opt/amd/lib64/libamdocl64.so

#14 0x00007ffff5e38d3e in ?? () from /opt/amd/lib64/libamdocl64.so

#15 0x00007ffff5e46338 in ?? () from /opt/amd/lib64/libamdocl64.so

#16 0x00007ffff5e275e7 in clBuildProgram () from /opt/amd/lib64/libamdocl64.so

#17 0x0000000000401c62 in calc_md5 (platform=0x7ffff739f140, ...) at openclmd5.c:304

#18 0x00000000004024a3 in main (argc=3, argv=0x7fffffffdf18) at openclmd5.c:418

 

The problems are:

1) function "md5" - parameter "hash" is in __global address space, but it is passed to md5_loop (via MD5Update macro) as input parameter which is in __private address space with no error.

 

2) seems constructions like

void md5_loop(ctxt, input, len)

          md5_ctxt *ctxt;

          u_int8_t *input;

          u_int len; /* number of bytes */

{

discard address space qualifiers (implicit __global to __private casts are allowed)

 

3) seems type casts like

md5_calc((u_int8_t *)(input + i), ctxt);

discard address space qualifiers (like previous)

Attachments

Outcomes