Repository navigation
Commit ad222e0
committed
GPU: make the Metal atomics operate on plain counters
GPUAtomic() expanded to metal::atomic, but the counters it guards are plain
integers in structures that the host allocates and transfers, and the code reads
them directly outside the atomic operations. That is exactly the CUDA and HIP
situation, where GPUAtomic() is a no-op and atomicAdd() takes a plain pointer,
so Metal now does the same.
MSL's atomic_*_explicit do want metal::atomic, which has the same size and
alignment, so the operand is cast at the one point where the operation is
issued. The cast has to keep the address space, which a generic pointer does not
carry into atomic_*_explicit, hence the two overloads: threadgroup stays
threadgroup for the *Shared entry points, anything else resolves to device.
GPUTPCCFDecodeZS's shared memory had to be declared GPUsharedref() for that to
hold; without it the reference is generic by the time AtomicAddShared sees it.1 parent 27f5bda commit ad222e0
4 files changed
Lines changed: 27 additions & 10 deletions
File tree
- GPU
- Common
- GPUTracking/TPCClusterFinder
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
492 | 509 | | |
493 | 510 | | |
494 | 511 | | |
| |||
499 | 516 | | |
500 | 517 | | |
501 | 518 | | |
502 | | - | |
| 519 | + | |
503 | 520 | | |
504 | 521 | | |
505 | 522 | | |
| |||
519 | 536 | | |
520 | 537 | | |
521 | 538 | | |
522 | | - | |
| 539 | + | |
523 | 540 | | |
524 | 541 | | |
525 | 542 | | |
| |||
537 | 554 | | |
538 | 555 | | |
539 | 556 | | |
540 | | - | |
| 557 | + | |
541 | 558 | | |
542 | 559 | | |
543 | 560 | | |
| |||
555 | 572 | | |
556 | 573 | | |
557 | 574 | | |
558 | | - | |
| 575 | + | |
559 | 576 | | |
560 | 577 | | |
561 | 578 | | |
| |||
573 | 590 | | |
574 | 591 | | |
575 | 592 | | |
576 | | - | |
| 593 | + | |
577 | 594 | | |
578 | 595 | | |
579 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments