Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/Stencil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool CheckResults(float *out, float *in, unsigned n) {
in[(i + 5) * n + (j + 0)] * 0.02f;

// check result
if (abs(res - out[i * n + j]) >= 0.0015f) {
if (std::abs(res - out[i * n + j]) >= 0.0015f) {
std::cout << "out[" << i << "][" << j << "] = " << out[i * n + j]
<< " expect result " << res << std::endl;
return false;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/api/bin_and_cmp_ops_heavy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ template <class T1, class T2, class OpClass> struct verify_n {
using Tint = esimd_test::int_type_t<sizeof(T)>;
Tint res_bits = *(Tint *)&res;
Tint gold_bits = *(Tint *)&gold;
return (abs(gold_bits - res_bits) > n) ? false : true;
return (std::abs(gold_bits - res_bits) > n) ? false : true;
}
};

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/api/unary_ops_heavy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool test(Ops ops, queue &q) {
? 1
: 0;

if ((Gold != Res) && (abs(ResBits - GoldBits) > delta)) {
if ((Gold != Res) && (std::abs(ResBits - GoldBits) > delta)) {
if (++err_cnt < 10) {
std::cout << " failed at index " << (res_off + j) << ", op "
<< esimd_test::Op2Str(op) << ": " << cast(Res)
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/esimd_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool cmp_binary_files(const char *testOutFile, const char *referenceFile,
double maxRelativeDiff = 0;
bool status = true;
for (size_t i = 0; i < size; i++) {
const auto diff = abs(testVec[i] - referenceVec[i]);
const auto diff = std::abs(testVec[i] - referenceVec[i]);
if (diff > tolerance) {
if (!mismatchRateTolerance || (totalMismatches < mismatchReportLimit)) {

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/ext_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ bool test(queue &Q, const std::string &Name,
}

bool BothFinite = std::isfinite(Test) && std::isfinite(Gold);
if (BothFinite && abs(Test - Gold) > delta) {
if (BothFinite && std::abs(Test - Gold) > delta) {
if (++ErrCnt < 10) {
std::cout << " failed at index " << I << ", " << Test
<< " != " << Gold << " (gold)\n";
Expand Down
5 changes: 3 additions & 2 deletions sycl/test-e2e/ESIMD/kmeans/kmeans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ bool verify_result(Centroid4 *centroids4, // gpu centroids result
float errY = std::fabs(centroids4[j].y[k] - centroids[i].y) /
max(std::fabs(centroids4[j].y[k]), std::fabs(centroids[i].y));
float errSize =
abs(centroids4[j].num_points[k] - centroids[i].num_points) /
max(abs(centroids4[j].num_points[k]), abs(centroids[i].num_points));
std::abs(centroids4[j].num_points[k] - centroids[i].num_points) /
max(std::abs(centroids4[j].num_points[k]),
std::abs(centroids[i].num_points));
// std::cout << i << ": Wanted (" << centroids[i].x << ", " <<
// centroids[i].y
// << ", " << centroids[i].num_points << ")" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions sycl/test-e2e/ESIMD/linear/bitmap_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ __SYCL_INLINE_VER_NAMESPACE(_V1) {
return false;
}

width = abs(*(short *)&header_out[18]);
height = abs(*(short *)&header_out[22]);
width = std::abs(*(short *)&header_out[18]);
height = std::abs(*(short *)&header_out[22]);

img_out = (unsigned char *)std::malloc(width * height * 3);
img_gold = (unsigned char *)std::malloc(width * height * 3);
Expand All @@ -276,7 +276,7 @@ __SYCL_INLINE_VER_NAMESPACE(_V1) {
fclose(f_gold);

for (i = 0; i < width * height * 3; i++) {
if (abs(img_out[i] - img_gold[i]) > tolerance) {
if (std::abs(img_out[i] - img_gold[i]) > tolerance) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/stencil2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool CheckResults(float *out, float *in, unsigned n) {
in[(i + 5) * n + (j + 0)] * 0.02f;

// check result
if (abs(res - out[i * n + j]) >= 0.0015f) {
if (std::abs(res - out[i * n + j]) >= 0.0015f) {
std::cout << "out[" << i << "][" << j << "] = " << out[i * n + j]
<< " expect result " << res << std::endl;
return false;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/vadd_half.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int main(int argc, char **argv) {
Tint ResBits = *(Tint *)&Res;
Tint GoldBits = *(Tint *)&Gold;

if (abs(ResBits - GoldBits) > 1) {
if (std::abs(ResBits - GoldBits) > 1) {
if (++err_cnt < 100) {
std::cout << "failed at index " << i << ": " << cast(Res) << "(0x"
<< std::hex << ResBits << ")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int main() {
}
for (int j = 0; j < NV; j++) {
auto d = s[j] - r[k * NV + j];
if (abs(d) > 1e-10) {
if (std::abs(d) > 1e-10) {
printf("partial fail ");
printf("%i\t%i\t%g\t%g\n", k, j, s[j], r[k * NV + j]);
fails++;
Expand Down