diff --git a/.github/workflows/build_and_run.yml b/.github/workflows/build_and_run.yml index 37cd16f3..cf99d555 100644 --- a/.github/workflows/build_and_run.yml +++ b/.github/workflows/build_and_run.yml @@ -165,8 +165,14 @@ jobs: &$script_path echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV - - name: Run benchmarks - run: dpbench -i ${{env.WORKLOADS}} run -r2 --no-print-results || exit 1 + - name: Run benchmarks fp64 + run: dpbench -i ${{env.WORKLOADS}} run -r2 --no-print-results --precision=double || exit 1 - - name: Generate report + - name: Generate report fp64 + run: dpbench -i ${{env.WORKLOADS}} report || exit 1 + + - name: Run benchmarks fp32 + run: dpbench -i ${{env.WORKLOADS}} run -r2 --no-print-results --precision=single || exit 1 + + - name: Generate report fp32 run: dpbench -i ${{env.WORKLOADS}} report || exit 1 diff --git a/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_kernel.hpp b/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_kernel.hpp index f1b7e2ba..ad99f5f4 100644 --- a/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_kernel.hpp +++ b/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_kernel.hpp @@ -8,8 +8,7 @@ using namespace sycl; -template -class BlackScholesKernel; +template class BlackScholesKernel; template void black_scholes_impl(queue Queue, diff --git a/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_sycl.cpp b/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_sycl.cpp index bf63c000..9c0202db 100644 --- a/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_sycl.cpp +++ b/dpbench/benchmarks/black_scholes/black_scholes_sycl_native_ext/black_scholes_sycl/_black_scholes_sycl.cpp @@ -65,17 +65,20 @@ void black_scholes_sync(size_t /**/, throw std::runtime_error("Input arrays are not acceptable."); if (typenum == UAR_FLOAT) { - black_scholes_impl(Queue, nopt, price.get_data(), - strike.get_data(), t.get_data(), rate, - volatility, call.get_data(), - put.get_data()); + black_scholes_impl( + Queue, nopt, price.get_data(), + strike.get_data(), t.get_data(), rate, + volatility, call.get_data(), + put.get_data()); } else if (typenum == UAR_DOUBLE) { - black_scholes_impl(Queue, nopt, price.get_data(), - strike.get_data(), t.get_data(), rate, - volatility, call.get_data(), - put.get_data()); + black_scholes_impl( + Queue, nopt, price.get_data(), + strike.get_data(), t.get_data(), rate, + volatility, call.get_data(), + put.get_data()); } else { - throw std::runtime_error("Expected a double or single precision FP array."); + throw std::runtime_error( + "Expected a double or single precision FP array."); } } diff --git a/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_kernel.hpp b/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_kernel.hpp index a8710484..34ae8fc4 100644 --- a/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_kernel.hpp +++ b/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_kernel.hpp @@ -106,8 +106,7 @@ void getNeighborhood(size_t n, } } -template -class DBScanKernel; +template class DBScanKernel; template size_t dbscan_impl(queue q, @@ -135,8 +134,7 @@ size_t dbscan_impl(queue q, size_t i2 = (i1 + 1 == n_samples ? n_samples : i1 + 1); getNeighborhood(n_samples, n_features, data, i2 - i1, data + i1 * n_features, eps, - d_indices + i1 * n_samples, - d_sizes + i1); + d_indices + i1 * n_samples, d_sizes + i1); }); }); diff --git a/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_sycl.cpp b/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_sycl.cpp index df059b8a..8dd05aa3 100644 --- a/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_sycl.cpp +++ b/dpbench/benchmarks/dbscan/dbscan_sycl_native_ext/dbscan_sycl/_dbscan_sycl.cpp @@ -45,10 +45,11 @@ size_t dbscan_sync(size_t n_samples, if (typenum == UAR_FLOAT) { return dbscan_impl(queue, n_samples, n_features, - data.get_data(), eps, min_pts); - } else if (typenum == UAR_DOUBLE) { + data.get_data(), eps, min_pts); + } + else if (typenum == UAR_DOUBLE) { return dbscan_impl(queue, n_samples, n_features, - data.get_data(), eps, min_pts); + data.get_data(), eps, min_pts); } throw std::runtime_error("Expected a double or single precision FP array."); diff --git a/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_kernel.hpp b/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_kernel.hpp index 2aae98ea..8f13d972 100644 --- a/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_kernel.hpp +++ b/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_kernel.hpp @@ -9,8 +9,7 @@ using namespace sycl; -template -class theKernel; +template class theKernel; template void l2_norm_impl(queue Queue, diff --git a/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_sycl.cpp b/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_sycl.cpp index dd4ce605..e9748a79 100644 --- a/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_sycl.cpp +++ b/dpbench/benchmarks/l2_norm/l2_norm_sycl_native_ext/l2_norm_sycl/_l2_norm_sycl.cpp @@ -23,12 +23,13 @@ void l2_norm_sync(dpctl::tensor::usm_ndarray a, dpctl::tensor::usm_ndarray d) if (typenum == UAR_FLOAT) { l2_norm_impl(Queue, npoints, dims, a.get_data(), - d.get_data()); + d.get_data()); } else if (typenum == UAR_DOUBLE) { l2_norm_impl(Queue, npoints, dims, a.get_data(), - d.get_data()); + d.get_data()); } else { - throw std::runtime_error("Expected a double or single precision FP array."); + throw std::runtime_error( + "Expected a double or single precision FP array."); } } diff --git a/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_kernel.hpp b/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_kernel.hpp index 6e15959c..14d24dad 100644 --- a/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_kernel.hpp +++ b/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_kernel.hpp @@ -12,6 +12,8 @@ using namespace sycl; #define SQRT(x) sqrt(x) #endif +template class PairwiseDistanceKernel; + template void pairwise_distance_impl(queue Queue, size_t npoints, @@ -21,7 +23,7 @@ void pairwise_distance_impl(queue Queue, FpTy *distance_op) { Queue.submit([&](handler &h) { - h.parallel_for( + h.parallel_for>( range<1>{npoints}, [=](id<1> myID) { size_t i = myID[0]; for (size_t j = 0; j < npoints; j++) { diff --git a/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_sycl.cpp b/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_sycl.cpp index 3a5dc725..bb584206 100644 --- a/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_sycl.cpp +++ b/dpbench/benchmarks/pairwise_distance/pairwise_distance_sycl_native_ext/pairwise_distance_sycl/_pairwise_distance_sycl.cpp @@ -51,16 +51,23 @@ void pairwise_distance_sync(dpctl::tensor::usm_ndarray X1, auto Queue = X1.get_queue(); auto ndims = 3; auto npoints = X1.get_size() / ndims; + auto typenum = X1.get_typenum(); if (!ensure_compatibility(X1, X2, D)) throw std::runtime_error("Input arrays are not acceptable."); - if (X1.get_typenum() != UAR_DOUBLE || X2.get_typenum() != UAR_DOUBLE) { - throw std::runtime_error("Expected a double precision FP array."); + if (typenum == UAR_FLOAT) { + pairwise_distance_impl(Queue, npoints, ndims, X1.get_data(), + X2.get_data(), D.get_data()); + } + else if (typenum == UAR_DOUBLE) { + pairwise_distance_impl(Queue, npoints, ndims, X1.get_data(), + X2.get_data(), D.get_data()); + } + else { + throw std::runtime_error( + "Expected a double precision FP array."); } - - pairwise_distance_impl(Queue, npoints, ndims, X1.get_data(), - X2.get_data(), D.get_data()); } PYBIND11_MODULE(_pairwise_distance_sycl, m) diff --git a/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_kernel.hpp b/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_kernel.hpp index 857db1ee..c090a72c 100644 --- a/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_kernel.hpp +++ b/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_kernel.hpp @@ -12,8 +12,7 @@ using namespace sycl; -template -class RamboKernel; +template class RamboKernel; template event rambo_impl(queue Queue, diff --git a/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_sycl.cpp b/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_sycl.cpp index be60bb9c..c6a8e2ff 100644 --- a/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_sycl.cpp +++ b/dpbench/benchmarks/rambo/rambo_sycl_native_ext/rambo_sycl/_rambo_sycl.cpp @@ -65,13 +65,16 @@ void rambo_sync(size_t nevts, F1.get_data(), Q1.get_data(), output.get_data()); e.wait(); - } else if (typenum == UAR_DOUBLE) { + } + else if (typenum == UAR_DOUBLE) { auto e = rambo_impl(Queue, nevts, nout, C1.get_data(), F1.get_data(), Q1.get_data(), output.get_data()); e.wait(); - } else { - throw std::runtime_error("Expected a double or single precision FP array."); + } + else { + throw std::runtime_error( + "Expected a double or single precision FP array."); } }