@@ -9445,7 +9445,7 @@ void InterlockedCompareStoreFloatBitwise<T:IAtomicable>(__ref T dest, T compar
9445
9445
/// @category math
9446
9446
__generic<T : __BuiltinFloatingPointType>
9447
9447
[__readNone]
9448
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9448
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9449
9449
bool isfinite(T x)
9450
9450
{
9451
9451
__target_switch
@@ -9463,7 +9463,7 @@ bool isfinite(T x)
9463
9463
9464
9464
__generic<T : __BuiltinFloatingPointType, let N : int>
9465
9465
[__readNone]
9466
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9466
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9467
9467
vector<bool, N> isfinite(vector<T, N> x)
9468
9468
{
9469
9469
__target_switch
@@ -9481,7 +9481,7 @@ vector<bool, N> isfinite(vector<T, N> x)
9481
9481
9482
9482
__generic<T : __BuiltinFloatingPointType, let N : int, let M : int>
9483
9483
[__readNone]
9484
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9484
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9485
9485
matrix<bool, N, M> isfinite(matrix<T, N, M> x)
9486
9486
{
9487
9487
__target_switch
@@ -9498,7 +9498,7 @@ matrix<bool, N, M> isfinite(matrix<T, N, M> x)
9498
9498
/// @category math
9499
9499
__generic<T : __BuiltinFloatingPointType>
9500
9500
[__readNone]
9501
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9501
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9502
9502
bool isinf(T x)
9503
9503
{
9504
9504
__target_switch
@@ -9512,12 +9512,14 @@ bool isinf(T x)
9512
9512
__intrinsic_asm "$P_isinf($0)";
9513
9513
case spirv:
9514
9514
return spirv_asm { result:$$bool = OpIsInf $x};
9515
+ case wgsl:
9516
+ __intrinsic_asm "($0 > 0x1.fffffep+127f) || ($0 < -0x1.fffffep+127f)";
9515
9517
}
9516
9518
}
9517
9519
9518
9520
__generic<T : __BuiltinFloatingPointType, let N : int>
9519
9521
[__readNone]
9520
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9522
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9521
9523
vector<bool, N> isinf(vector<T, N> x)
9522
9524
{
9523
9525
__target_switch
@@ -9535,7 +9537,7 @@ vector<bool, N> isinf(vector<T, N> x)
9535
9537
9536
9538
__generic<T : __BuiltinFloatingPointType, let N : int, let M : int>
9537
9539
[__readNone]
9538
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9540
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9539
9541
matrix<bool, N, M> isinf(matrix<T, N, M> x)
9540
9542
{
9541
9543
__target_switch
@@ -9552,7 +9554,7 @@ matrix<bool, N, M> isinf(matrix<T, N, M> x)
9552
9554
/// @category math
9553
9555
__generic<T : __BuiltinFloatingPointType>
9554
9556
[__readNone]
9555
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9557
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9556
9558
bool isnan(T x)
9557
9559
{
9558
9560
__target_switch
@@ -9566,12 +9568,14 @@ bool isnan(T x)
9566
9568
__intrinsic_asm "$P_isnan($0)";
9567
9569
case spirv:
9568
9570
return spirv_asm { result:$$bool = OpIsNan $x};
9571
+ case wgsl:
9572
+ __intrinsic_asm "$0 != $0";
9569
9573
}
9570
9574
}
9571
9575
9572
9576
__generic<T : __BuiltinFloatingPointType, let N : int>
9573
9577
[__readNone]
9574
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9578
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9575
9579
vector<bool, N> isnan(vector<T, N> x)
9576
9580
{
9577
9581
__target_switch
@@ -9589,7 +9593,7 @@ vector<bool, N> isnan(vector<T, N> x)
9589
9593
9590
9594
__generic<T : __BuiltinFloatingPointType, let N : int, let M : int>
9591
9595
[__readNone]
9592
- [require(cpp_cuda_glsl_hlsl_metal_spirv , sm_4_0_version)]
9596
+ [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl , sm_4_0_version)]
9593
9597
matrix<bool, N, M> isnan(matrix<T, N, M> x)
9594
9598
{
9595
9599
__target_switch
0 commit comments