Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 718 Bytes

atomic_init.adoc

File metadata and controls

44 lines (27 loc) · 718 Bytes

atomic_init

Non-atomically initializes an atomic object pointed to by obj to a specified value.

void atomic_init(volatile A *obj,
                 C value)

Description

The atomic_init function non-atomically initializes the atomic object pointed to by obj to the value value.

Example

    local atomic_int local_guide;
    if (get_local_id(0) == 0)
       atomic_init(&guide, 42);
    work_group_barrier(CLK_LOCAL_MEM_FENCE);