Has anyone managed to implement atomicMin using floating point numbers? I’ve made an attempt:

```
__device__ void Min(float *addr, float value)
{
float comp_value = *addr;
if(comp_value <= value) return 0;
while(comp_value > value)
{
unsigned int tmpA, tmpB;
memcpy(&tmpB, &value, sizeof(unsigned int));
memcpy(&tmpA, &comp_value, sizeof(unsigned int));
unsigned int *tmp_ptr = (unsigned int *)addr;
unsigned int tmp_result = atomicCAS(tmp_ptr, tmpA, tmpB);
float result;
memcpy(&result, &tmp_result, sizeof(unsigned int));
if(result == comp_value) return;
comp_value = result;
}
}
```

but it doesn’t seem to be working correctly.