MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GpuAtomicCasHelper

Function GpuAtomicCasHelper

tensorflow/core/util/gpu_device_functions.h:526–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524// Helper function for atomic accumulation implemented as CAS.
525template <typename T, typename F>
526__device__ T GpuAtomicCasHelper(T* ptr, F accumulate) {
527 T old = *ptr;
528 T assumed;
529 do {
530 assumed = old;
531 old = atomicCAS(ptr, assumed, accumulate(assumed));
532 } while (assumed != old);
533 return old;
534}
535CREATE_CUDA_DEVICE_FUNCTION_ALIAS(GpuAtomicCasHelper, CudaAtomicCasHelper);
536
537// Overload for int64

Callers 14

int64 GpuAtomicAddMethod · 0.85
half GpuAtomicAddMethod · 0.85
GpuAtomicAddFunction · 0.85
half GpuAtomicSubMethod · 0.85
GpuAtomicMaxFunction · 0.85
half GpuAtomicMaxMethod · 0.85
uint64 GpuAtomicMaxMethod · 0.85
GpuAtomicMinFunction · 0.85
half GpuAtomicMinMethod · 0.85
uint64 GpuAtomicMinMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected