Skip to content

Commit e224c7c

Browse files
committed
[GPU opt guide][SYCL][joint matrix] Add explicit std <cmath> to math function
1 parent e7f225b commit e224c7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Publications/GPU-Opt-Guide/joint-matrix/joint-matrix.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// SPDX-License-Identifier: MIT
55
// =============================================================
66

7+
#include <cmath>
78
#include <iostream>
89
#include <sycl/sycl.hpp>
910

@@ -136,7 +137,7 @@ int test() {
136137
for (int i = 0; i < M; i++) {
137138
for (int j = 0; j < N; j++) {
138139
if constexpr (std::is_same_v<Tc, float>) {
139-
if (fabs(C[i * N + j] - D[i * N + j]) > BF16_EPSILON) {
140+
if (std::fabs(C[i * N + j] - D[i * N + j]) > BF16_EPSILON) {
140141
res = false;
141142
std::cout << "Incorrect result in matrix. "
142143
<< "i: " << i << ", j: " << j << ", Ref: " << D[i * N + j]

0 commit comments

Comments
 (0)