The OpenCL C++ bindings version 1.2 use a GCC builtin (__sync_val_compare_and_swap) that is not provided by the PGI C++ compiler for x86/x86_64 Linux. (Apparently, some other compiler vendors such as Intel do provide it for compatibility.)

Has anyone found a reasonable workaround? My attempts to provide an implementation of this builtin as a function (inlined or otherwise) causes the templated method that uses the builtin to be outlined, leading to multiply-defined symbol link errors in the code I'm working on.