Skip to content
Open
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
12 changes: 12 additions & 0 deletions src/bincount-omp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ add_hecbench_benchmark(
SOURCES main.cpp
CATEGORIES algorithms
)

# Exact histogram validation requires the host reference and Intel GPU kernel
# to use the same floating-point division semantics.
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
target_compile_options(bincount-omp PRIVATE -fp-model=precise)
target_compile_definitions(bincount-omp PRIVATE
__STRICT_ANSI__
)
target_link_options(bincount-omp PRIVATE
"SHELL:-Xopenmp-target-backend -cl-fp32-correctly-rounded-divide-sqrt"
)
endif()
2 changes: 1 addition & 1 deletion src/bincount-omp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ifeq ($(OPTIMIZE),yes)
endif

ifeq ($(DEVICE),gpu)
CFLAGS +=-fiopenmp -fopenmp-targets=spir64 -D__STRICT_ANSI__ -DHAVE_OMPX_DEVICE_INFO
CFLAGS +=-fiopenmp -fopenmp-targets=spir64 -D__STRICT_ANSI__
LDFLAGS +=-Xopenmp-target-backend "-cl-fp32-correctly-rounded-divide-sqrt"
else
CFLAGS +=-qopenmp
Expand Down
347 changes: 248 additions & 99 deletions src/bincount-omp/main.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/dwconv-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void dwconv2d_forward (const int m,
int errors = 0;
for (int i = 0; i < output_size; i++) {
const scalar_t tolerance = 1e-4f + 1e-4f * fabs(h_reference[i]);
if (fabs(h_output[i] - h_reference[i]) > tolerance)
if (!(fabs(h_output[i] - h_reference[i]) <= tolerance))
errors++;
Comment thread
Copilot marked this conversation as resolved.
}
printf("%s\n", errors == 0 ? "PASS" : "FAIL");
Expand Down
2 changes: 1 addition & 1 deletion src/dwconv-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void dwconv2d_forward (const int m,
int errors = 0;
for (int i = 0; i < output_size; i++) {
const scalar_t tolerance = 1e-4f + 1e-4f * fabs(h_reference[i]);
if (fabs(h_output[i] - h_reference[i]) > tolerance)
if (!(fabs(h_output[i] - h_reference[i]) <= tolerance))
errors++;
Comment thread
Copilot marked this conversation as resolved.
}
printf("%s\n", errors == 0 ? "PASS" : "FAIL");
Expand Down
2 changes: 1 addition & 1 deletion src/dwconv-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void dwconv2d_forward (const int m,
int errors = 0;
for (int i = 0; i < output_size; i++) {
const scalar_t tolerance = 1e-4f + 1e-4f * fabs(h_reference[i]);
if (fabs(h_output[i] - h_reference[i]) > tolerance)
if (!(fabs(h_output[i] - h_reference[i]) <= tolerance))
errors++;
Comment thread
Copilot marked this conversation as resolved.
}
printf("%s\n", errors == 0 ? "PASS" : "FAIL");
Expand Down
2 changes: 1 addition & 1 deletion src/dwconv-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void dwconv2d_forward (sycl::queue &q,
int errors = 0;
for (int i = 0; i < output_size; i++) {
const scalar_t tolerance = 1e-4f + 1e-4f * fabs(h_reference[i]);
if (fabs(h_output[i] - h_reference[i]) > tolerance)
if (!(fabs(h_output[i] - h_reference[i]) <= tolerance))
errors++;
Comment thread
Copilot marked this conversation as resolved.
}
printf("%s\n", errors == 0 ? "PASS" : "FAIL");
Expand Down
8 changes: 0 additions & 8 deletions src/pointerchase-omp/CMakeLists.txt

This file was deleted.

62 changes: 0 additions & 62 deletions src/pointerchase-omp/Makefile

This file was deleted.

66 changes: 0 additions & 66 deletions src/pointerchase-omp/Makefile.aomp

This file was deleted.

63 changes: 0 additions & 63 deletions src/pointerchase-omp/Makefile.nvc

This file was deleted.

Loading