Commit c0e4d40
committed
MathUtils: make SMatrixGPU compile as MSL
Three separate issues:
* Metal has no static storage duration inside a function, so
MatRepSymGPU::off() drops the static on its offset table. Nothing is
lost by dropping it everywhere rather than forking: arrays, unlike
scalars, are emitted into read-only data either way. On the host it is
marginally better, since the static form reached the table through the
GOT.
* operator=(Expr) now takes the expression by value. MSL folds the
address space into a deduced parameter, so the generic
operator=(const M&) deduced M = thread Expr<...>, matched exactly, beat
the Expr overload and then tried mRep = rhs.mRep on an expression. A
by-value parameter has no address space to deduce, so the Expr overload
wins on Metal as it already did elsewhere. Expr is two references, so
there is no copy cost.
* Metal supports up to C++17, so it needs the same treatment as OpenCL
for a requires-clause.1 parent 0f3fb8b commit c0e4d40
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
| 459 | + | |
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
| 680 | + | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| |||
0 commit comments