Skip to content

DPCT1007:2: Migration of atomicDec is not supported #559

@zjin-lcf

Description

@zjin-lcf

DPCT1007:2: Migration of atomicDec is not supported. However, atomicInc() can be migrated.

I posted a feature request (intel/llvm#8220).

Could you please explain that the implementation of atomicDec() below does not work ? Thanks.

        // atomicDec(&gpuData[8], 137)

        auto ao8 = atomic_ref<T, memory_order::relaxed, memory_scope::device,
                              access::address_space::global_space>(gpuData[8]);
        while (true) {
          T old = ao8.load();
          if (old == 0 || old > 137) {
            if (ao8.compare_exchange_strong(old, 137)) break;
          } else if (ao8.compare_exchange_strong(old, old - 1)) break;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions