@@ -39,7 +39,7 @@ template <typename RealType>
39
39
std::int32_t t_test (sycl::queue& q, RealType* r, std::int64_t n,
40
40
RealType expected_mean) {
41
41
std::int32_t res = -1 ;
42
- RealType sqrt_n_observations = sycl ::sqrt (static_cast <RealType>(n));
42
+ RealType sqrt_n_observations = std ::sqrt (static_cast <RealType>(n));
43
43
44
44
// Allocate memory to be passed inside oneMKL stats functions
45
45
RealType* mean = sycl::malloc_shared<RealType>(1 , q);
@@ -53,8 +53,8 @@ std::int32_t t_test(sycl::queue& q, RealType* r, std::int64_t n,
53
53
oneapi::mkl::stats::central_moment (q, mean, dataset, variance);
54
54
q.wait_and_throw ();
55
55
// Check the condition
56
- if ((sycl ::abs (mean[0 ] - expected_mean) * sqrt_n_observations /
57
- sycl ::sqrt (variance[0 ])) < static_cast <RealType>(threshold)) {
56
+ if ((std ::abs (mean[0 ] - expected_mean) * sqrt_n_observations /
57
+ std ::sqrt (variance[0 ])) < static_cast <RealType>(threshold)) {
58
58
res = 1 ;
59
59
} else {
60
60
res = 0 ;
@@ -95,8 +95,8 @@ std::int32_t t_test(sycl::queue& q, RealType* r1, std::int64_t n1,
95
95
bool almost_equal =
96
96
(variance1[0 ] < 2 * variance2[0 ]) || (variance2[0 ] < 2 * variance1[0 ]);
97
97
if (almost_equal) {
98
- if ((sycl ::abs (mean1[0 ] - mean2[0 ]) /
99
- sycl ::sqrt ((static_cast <RealType>(1.0 ) / static_cast <RealType>(n1) +
98
+ if ((std ::abs (mean1[0 ] - mean2[0 ]) /
99
+ std ::sqrt ((static_cast <RealType>(1.0 ) / static_cast <RealType>(n1) +
100
100
static_cast <RealType>(1.0 ) / static_cast <RealType>(n2)) *
101
101
((n1 - 1 ) * (n1 - 1 ) * variance1[0 ] +
102
102
(n2 - 1 ) * (n2 - 1 ) * variance2[0 ]) /
@@ -106,8 +106,8 @@ std::int32_t t_test(sycl::queue& q, RealType* r1, std::int64_t n1,
106
106
res = 0 ;
107
107
}
108
108
} else {
109
- if ((sycl ::abs (mean1[0 ] - mean2[0 ]) /
110
- sycl ::sqrt ((variance1[0 ] + variance2[0 ]))) <
109
+ if ((std ::abs (mean1[0 ] - mean2[0 ]) /
110
+ std ::sqrt ((variance1[0 ] + variance2[0 ]))) <
111
111
static_cast <RealType>(threshold)) {
112
112
res = 1 ;
113
113
} else {
@@ -201,4 +201,4 @@ int main(int argc, char** argv) {
201
201
std::cout << " T-test result with two input arrays: " << res1 << " \n\n " ;
202
202
203
203
return 0 ;
204
- }
204
+ }
0 commit comments