cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

wohlbier
Journeyman III

int64 atom_cmpxchg on AMD 6168 CPU

The OpenCL code below fails to compile for an AMD 6168 CPU. AMD_APP version 2.8. Note the compiler does not complain about cl_khr_int64_base_atomics, so I have to assume they are supported for the 6168. The compiler error is listed before the code, and note that the signature I'm trying to use for atomic_cmpxchg is listed in the OpenCL spec.

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/cl_khr_int64_base_atomics.html

Thanks for any help!

jgw

2: clBuildProgram failed:

2: "/tmp/OCLOciay5.cl", line 46: error: no instance of overloaded function

2:           "atomic_cmpxchg" matches the argument list

2:             argument types are: (volatile __global ulong *, ulong, ulong)

2:     } while (atomic_cmpxchg((volatile __global unsigned long *)source,

2:              ^

2:

2: 1 error detected in the compilation of "/tmp/OCLOciay5.cl".

2:

2: Frontend phase failed compilation.

2:

2: -D__OCL_AMD__ -I/home/wohlbier/Chicoma/chicoma/config/../src/util -Werror -cl-strict-aliasing -cl-fast-relaxed-math -cl-std=CL1.1

// enable int64 atomics

#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable

typedef double real_t;

inline void atomic_real_add(volatile __global real_t * source,

                  const real_t operand) {

  union {

    unsigned long intVal;

    real_t realVal;

  } newVal;

  union {

    unsigned long intVal;

    real_t realVal;

  } prevVal;

  do {

    prevVal.realVal = *source;

    newVal.realVal = prevVal.realVal + operand;

  } while (atomic_cmpxchg((volatile __global unsigned long *)source,

                prevVal.intVal, newVal.intVal) != prevVal.intVal);

}

5 Replies
himanshu_gautam
Grandmaster

You can check what all extension are supported by your OpenCL devices using clinfo. Just check once if the extension is supported. Can you post the complete error message?

It will be also easier if you can post a small repro case, to confirm the issue.

EDIT: I could reproduce the issue on my setup here. I will forward it to AMD Engg team.

Thanks for reporting.

Message was edited by: Himanshu Gautam

0 Likes

Any news on this?

0 Likes

I have asked the status. I will let you know if i hear something.

0 Likes

Got the same problem. Is there any workaround available?

0 Likes

The kernel compiles without any problems when -Dcl_khr_int64_base_atomics is used,

'double real_t' is changed to 'unsigned long real_t', and
'atomic_cmpxchg' is changed to 'atom_cmpxchg'.


Can you make these changes and let us know the result?