@@ -54,25 +54,25 @@ mod private {
54
54
55
55
macro_rules! f32_intrinsic {
56
56
( $self: expr, $func: ident( $( $param: expr) ,* ) ) => { {
57
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
57
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
58
58
let val = $self. $func( $( $param) ,* ) ;
59
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
59
+ #[ cfg( target_arch = "nvptx64" ) ]
60
60
let val = paste:: paste! { unsafe { intrinsics:: [ <$func f>] ( $self, $( $param) ,* ) } } ;
61
61
val
62
62
} } ;
63
63
}
64
64
65
65
macro_rules! f64_intrinsic {
66
66
( $self: expr, $func: ident( $( $param: expr) ,* ) ) => { {
67
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
67
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
68
68
let val = $self. $func( $( $param) ,* ) ;
69
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
69
+ #[ cfg( target_arch = "nvptx64" ) ]
70
70
let val = unsafe { intrinsics:: $func( $self, $( $param) ,* ) } ;
71
71
val
72
72
} } ;
73
73
}
74
74
75
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
75
+ #[ cfg( target_arch = "nvptx64" ) ]
76
76
use crate :: intrinsics;
77
77
78
78
impl GpuFloat for f32 {
@@ -117,9 +117,9 @@ impl GpuFloat for f32 {
117
117
#[ must_use = "method returns a new number and does not mutate the original value" ]
118
118
#[ inline]
119
119
fn abs ( self ) -> f32 {
120
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
120
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
121
121
let val = self . abs ( ) ;
122
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
122
+ #[ cfg( target_arch = "nvptx64" ) ]
123
123
let val = { unsafe { intrinsics:: fabsf ( self ) } } ;
124
124
val
125
125
}
@@ -161,9 +161,9 @@ impl GpuFloat for f32 {
161
161
#[ must_use = "method returns a new number and does not mutate the original value" ]
162
162
#[ inline]
163
163
fn mul_add ( self , a : f32 , b : f32 ) -> f32 {
164
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
164
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
165
165
let val = self . mul_add ( a, b) ;
166
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
166
+ #[ cfg( target_arch = "nvptx64" ) ]
167
167
let val = { unsafe { intrinsics:: fmaf ( self , a, b) } } ;
168
168
val
169
169
}
@@ -218,9 +218,9 @@ impl GpuFloat for f32 {
218
218
#[ must_use = "method returns a new number and does not mutate the original value" ]
219
219
#[ inline]
220
220
fn powf ( self , n : f32 ) -> f32 {
221
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
221
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
222
222
let val = self . powf ( n) ;
223
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
223
+ #[ cfg( target_arch = "nvptx64" ) ]
224
224
let val = { unsafe { intrinsics:: powf ( self , n) } } ;
225
225
val
226
226
}
@@ -252,9 +252,9 @@ impl GpuFloat for f32 {
252
252
#[ must_use = "method returns a new number and does not mutate the original value" ]
253
253
#[ inline]
254
254
fn ln ( self ) -> f32 {
255
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
255
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
256
256
let val = self . ln ( ) ;
257
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
257
+ #[ cfg( target_arch = "nvptx64" ) ]
258
258
let val = { unsafe { intrinsics:: logf ( self ) } } ;
259
259
val
260
260
}
@@ -362,9 +362,9 @@ impl GpuFloat for f32 {
362
362
/// `(sin(x), cos(x))`.
363
363
#[ inline]
364
364
fn sin_cos ( self ) -> ( f32 , f32 ) {
365
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
365
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
366
366
let val = self . sin_cos ( ) ;
367
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
367
+ #[ cfg( target_arch = "nvptx64" ) ]
368
368
let val = {
369
369
let mut sptr = 0.0 ;
370
370
let mut cptr = 0.0 ;
@@ -381,9 +381,9 @@ impl GpuFloat for f32 {
381
381
#[ must_use = "method returns a new number and does not mutate the original value" ]
382
382
#[ inline]
383
383
fn exp_m1 ( self ) -> f32 {
384
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
384
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
385
385
let val = self . exp_m1 ( ) ;
386
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
386
+ #[ cfg( target_arch = "nvptx64" ) ]
387
387
let val = { unsafe { intrinsics:: expm1f ( self ) } } ;
388
388
val
389
389
}
@@ -393,9 +393,9 @@ impl GpuFloat for f32 {
393
393
#[ must_use = "method returns a new number and does not mutate the original value" ]
394
394
#[ inline]
395
395
fn ln_1p ( self ) -> f32 {
396
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
396
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
397
397
let val = self . ln_1p ( ) ;
398
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
398
+ #[ cfg( target_arch = "nvptx64" ) ]
399
399
let val = { unsafe { intrinsics:: log1pf ( self ) } } ;
400
400
val
401
401
}
@@ -485,9 +485,9 @@ impl GpuFloat for f64 {
485
485
#[ must_use = "method returns a new number and does not mutate the original value" ]
486
486
#[ inline]
487
487
fn abs ( self ) -> f64 {
488
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
488
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
489
489
let val = self . abs ( ) ;
490
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
490
+ #[ cfg( target_arch = "nvptx64" ) ]
491
491
let val = { unsafe { intrinsics:: fabs ( self ) } } ;
492
492
val
493
493
}
@@ -529,9 +529,9 @@ impl GpuFloat for f64 {
529
529
#[ must_use = "method returns a new number and does not mutate the original value" ]
530
530
#[ inline]
531
531
fn mul_add ( self , a : f64 , b : f64 ) -> f64 {
532
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
532
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
533
533
let val = self . mul_add ( a, b) ;
534
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
534
+ #[ cfg( target_arch = "nvptx64" ) ]
535
535
let val = { unsafe { intrinsics:: fma ( self , a, b) } } ;
536
536
val
537
537
}
@@ -586,9 +586,9 @@ impl GpuFloat for f64 {
586
586
#[ must_use = "method returns a new number and does not mutate the original value" ]
587
587
#[ inline]
588
588
fn powf ( self , n : f64 ) -> f64 {
589
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
589
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
590
590
let val = self . powf ( n) ;
591
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
591
+ #[ cfg( target_arch = "nvptx64" ) ]
592
592
let val = { unsafe { intrinsics:: pow ( self , n) } } ;
593
593
val
594
594
}
@@ -620,9 +620,9 @@ impl GpuFloat for f64 {
620
620
#[ must_use = "method returns a new number and does not mutate the original value" ]
621
621
#[ inline]
622
622
fn ln ( self ) -> f64 {
623
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
623
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
624
624
let val = self . ln ( ) ;
625
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
625
+ #[ cfg( target_arch = "nvptx64" ) ]
626
626
let val = { unsafe { intrinsics:: log ( self ) } } ;
627
627
val
628
628
}
@@ -730,9 +730,9 @@ impl GpuFloat for f64 {
730
730
/// `(sin(x), cos(x))`.
731
731
#[ inline]
732
732
fn sin_cos ( self ) -> ( f64 , f64 ) {
733
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
733
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
734
734
let val = self . sin_cos ( ) ;
735
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
735
+ #[ cfg( target_arch = "nvptx64" ) ]
736
736
let val = {
737
737
let mut sptr = 0.0 ;
738
738
let mut cptr = 0.0 ;
@@ -749,9 +749,9 @@ impl GpuFloat for f64 {
749
749
#[ must_use = "method returns a new number and does not mutate the original value" ]
750
750
#[ inline]
751
751
fn exp_m1 ( self ) -> f64 {
752
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
752
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
753
753
let val = self . exp_m1 ( ) ;
754
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
754
+ #[ cfg( target_arch = "nvptx64" ) ]
755
755
let val = { unsafe { intrinsics:: expm1 ( self ) } } ;
756
756
val
757
757
}
@@ -761,9 +761,9 @@ impl GpuFloat for f64 {
761
761
#[ must_use = "method returns a new number and does not mutate the original value" ]
762
762
#[ inline]
763
763
fn ln_1p ( self ) -> f64 {
764
- #[ cfg( not( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ) ]
764
+ #[ cfg( not( target_arch = "nvptx64" ) ) ]
765
765
let val = self . ln_1p ( ) ;
766
- #[ cfg( any ( target_arch = "nvptx" , target_arch = " nvptx64") ) ]
766
+ #[ cfg( target_arch = "nvptx64" ) ]
767
767
let val = { unsafe { intrinsics:: log1p ( self ) } } ;
768
768
val
769
769
}
0 commit comments