From c52b378660ec0252c39563cc48d716d5a150a01a Mon Sep 17 00:00:00 2001 From: Tony Feng <103078747+chuanyuf@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:59:18 -0500 Subject: [PATCH 1/4] Merge pull request #2696 from noffermans/add_nnz_to_set_csr_data_sparse_cg_example Add nnz argument to set_csr_data in sparse CG examples --- Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp | 5 +++++ Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp b/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp index eec3f82891..f44bfc8c95 100644 --- a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp +++ b/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp @@ -380,8 +380,13 @@ int run_sparse_pcg_example(const sycl::device &dev) // setup optimizations and properties we know about A matrix oneapi::mkl::sparse::init_matrix_handle(&A); +#if (INTEL_MKL_VERSION < 20250300) auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); +#else + auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, nnz, + oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); +#endif oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::symmetric); oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::sorted); diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp b/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp index adb2360ac8..48a8deb043 100644 --- a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp +++ b/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp @@ -453,8 +453,13 @@ int run_sparse_pcg_example(const sycl::device &dev) // setup optimizations and properties we know about A matrix oneapi::mkl::sparse::init_matrix_handle(&A); +#if (INTEL_MKL_VERSION < 20250300) auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); +#else + auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, nnz, + oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); +#endif oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::symmetric); oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::sorted); From ba8f31e417736c5420ce4dc8a742a6a0d74a39bf Mon Sep 17 00:00:00 2001 From: Tony Feng <103078747+chuanyuf@users.noreply.github.com> Date: Tue, 27 Jan 2026 09:19:14 -0600 Subject: [PATCH 2/4] Merge pull request #2702 from andreyfe1/onemkl_moving [oneMKL] Samples have been moved to the separate repository --- .gitmodules | 3 + .../01_dpct_output/CMakeLists.txt | 0 .../01_dpct_output/MainSourceFiles.yaml | 0 .../longstaff_schwartz_svd_2.dp.cpp | 0 .../02_sycl_migrated_optimized/CMakeLists.txt | 0 .../MainSourceFiles.yaml | 0 .../include/dpct/atomic.hpp | 0 .../include/dpct/bindless_images.hpp | 0 .../include/dpct/blas_gemm_utils.hpp | 0 .../include/dpct/blas_utils.hpp | 0 .../include/dpct/ccl_utils.hpp | 0 .../include/dpct/codepin/codepin.hpp | 0 .../dpct/codepin/serialization/basic.hpp | 0 .../include/dpct/compat_service.hpp | 0 .../include/dpct/device.hpp | 0 .../include/dpct/dnnl_utils.hpp | 0 .../include/dpct/dpct.hpp | 0 .../include/dpct/dpl_extras/algorithm.h | 0 .../dpct/dpl_extras/dpcpp_extensions.h | 0 .../include/dpct/dpl_extras/functional.h | 0 .../dpct/dpl_extras/iterator_adaptor.h | 0 .../include/dpct/dpl_extras/iterators.h | 0 .../include/dpct/dpl_extras/memory.h | 0 .../include/dpct/dpl_extras/numeric.h | 0 .../include/dpct/dpl_extras/vector.h | 0 .../include/dpct/dpl_utils.hpp | 0 .../include/dpct/fft_utils.hpp | 0 .../include/dpct/graph.hpp | 0 .../include/dpct/group_utils.hpp | 0 .../include/dpct/image.hpp | 0 .../include/dpct/kernel.hpp | 0 .../include/dpct/lapack_utils.hpp | 0 .../include/dpct/lib_common_utils.hpp | 0 .../include/dpct/math.hpp | 0 .../include/dpct/memory.hpp | 0 .../include/dpct/rng_utils.hpp | 0 .../include/dpct/sparse_utils.hpp | 0 .../include/dpct/util.hpp | 0 .../longstaff_schwartz_svd_2.dp.cpp | 0 .../CMakeLists.txt | 0 .../License.txt | 0 .../README.md | 0 .../sample.json | 0 .../src/longstaff_schwartz_svd_2.cu | 0 .../third-party-programs.txt | 0 .../01_sycl_dpct_output/Common/cublas_utils.h | 0 .../Level-1/cublas_amax_example.dp.cpp | 0 .../Level-1/cublas_amin_example.dp.cpp | 0 .../Level-1/cublas_asum_example.dp.cpp | 0 .../Level-1/cublas_axpy_example.dp.cpp | 0 .../Level-1/cublas_copy_example.dp.cpp | 0 .../Level-1/cublas_dot_example.dp.cpp | 0 .../Level-1/cublas_dotc_example.dp.cpp | 0 .../Level-1/cublas_nrm2_example.dp.cpp | 0 .../Level-1/cublas_rot_example.dp.cpp | 0 .../Level-1/cublas_rotg_example.dp.cpp | 0 .../Level-1/cublas_rotm_example.dp.cpp | 0 .../Level-1/cublas_rotmg_example.dp.cpp | 0 .../Level-1/cublas_scal_example.dp.cpp | 0 .../Level-1/cublas_swap_example.dp.cpp | 0 .../Level-2/cublas_gbmv_example.dp.cpp | 0 .../Level-2/cublas_gemv_example.dp.cpp | 0 .../Level-2/cublas_ger_example.dp.cpp | 0 .../Level-2/cublas_hbmv_example.dp.cpp | 0 .../Level-2/cublas_hemv_example.dp.cpp | 0 .../Level-2/cublas_her2_example.dp.cpp | 0 .../Level-2/cublas_her_example.dp.cpp | 0 .../Level-2/cublas_hpmv_example.dp.cpp | 0 .../Level-2/cublas_hpr2_example.dp.cpp | 0 .../Level-2/cublas_hpr_example.dp.cpp | 0 .../Level-2/cublas_sbmv_example.dp.cpp | 0 .../Level-2/cublas_spmv_example.dp.cpp | 0 .../Level-2/cublas_spr2_example.dp.cpp | 0 .../Level-2/cublas_spr_example.dp.cpp | 0 .../Level-2/cublas_symv_example.dp.cpp | 0 .../Level-2/cublas_syr2_example.dp.cpp | 0 .../Level-2/cublas_syr_example.dp.cpp | 0 .../Level-2/cublas_tbmv_example.dp.cpp | 0 .../Level-2/cublas_tbsv_example.dp.cpp | 0 .../Level-2/cublas_tpmv_example.dp.cpp | 0 .../Level-2/cublas_tpsv_example.dp.cpp | 0 .../Level-2/cublas_trmv_example.dp.cpp | 0 .../Level-2/cublas_trsv_example.dp.cpp | 0 .../Level-3/cublas_gemm3m_example.dp.cpp | 0 .../Level-3/cublas_gemmBatched_example.dp.cpp | 0 .../cublas_gemmStridedBatched_example.dp.cpp | 0 .../Level-3/cublas_gemm_example.dp.cpp | 0 .../Level-3/cublas_hemm_example.dp.cpp | 0 .../Level-3/cublas_her2k_example.dp.cpp | 0 .../Level-3/cublas_herk_example.dp.cpp | 0 .../Level-3/cublas_herkx_example.dp.cpp | 0 .../Level-3/cublas_symm_example.dp.cpp | 0 .../Level-3/cublas_syr2k_example.dp.cpp | 0 .../Level-3/cublas_syrk_example.dp.cpp | 0 .../Level-3/cublas_syrkx_example.dp.cpp | 0 .../Level-3/cublas_trmm_example.dp.cpp | 0 .../Level-3/cublas_trsmBatched_example.dp.cpp | 0 .../Level-3/cublas_trsm_example.dp.cpp | 0 .../02_sycl_dpct_migrated/CMakeLists.txt | 0 .../Common/cublas_utils.h | 0 .../Level-1/CMakeLists.txt | 0 .../02_sycl_dpct_migrated/Level-1/amax.cpp | 0 .../02_sycl_dpct_migrated/Level-1/amin.cpp | 0 .../02_sycl_dpct_migrated/Level-1/asum.cpp | 0 .../02_sycl_dpct_migrated/Level-1/axpy.cpp | 0 .../02_sycl_dpct_migrated/Level-1/copy.cpp | 0 .../02_sycl_dpct_migrated/Level-1/dot.cpp | 0 .../02_sycl_dpct_migrated/Level-1/dotc.cpp | 0 .../02_sycl_dpct_migrated/Level-1/nrm2.cpp | 0 .../02_sycl_dpct_migrated/Level-1/rot.cpp | 0 .../02_sycl_dpct_migrated/Level-1/rotg.cpp | 0 .../02_sycl_dpct_migrated/Level-1/rotm.cpp | 0 .../02_sycl_dpct_migrated/Level-1/rotmg.cpp | 0 .../02_sycl_dpct_migrated/Level-1/scal.cpp | 0 .../02_sycl_dpct_migrated/Level-1/swap.cpp | 0 .../Level-2/CMakeLists.txt | 0 .../02_sycl_dpct_migrated/Level-2/gbmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/gemv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/ger.cpp | 0 .../02_sycl_dpct_migrated/Level-2/hbmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/hemv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/her.cpp | 0 .../02_sycl_dpct_migrated/Level-2/her2.cpp | 0 .../02_sycl_dpct_migrated/Level-2/hpmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/hpr.cpp | 0 .../02_sycl_dpct_migrated/Level-2/hpr2.cpp | 0 .../02_sycl_dpct_migrated/Level-2/sbmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/spmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/spr.cpp | 0 .../02_sycl_dpct_migrated/Level-2/spr2.cpp | 0 .../02_sycl_dpct_migrated/Level-2/symv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/syr.cpp | 0 .../02_sycl_dpct_migrated/Level-2/syr2.cpp | 0 .../02_sycl_dpct_migrated/Level-2/tbmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/tbsv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/tpmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/tpsv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/trmv.cpp | 0 .../02_sycl_dpct_migrated/Level-2/trsv.cpp | 0 .../Level-3/CMakeLists.txt | 0 .../02_sycl_dpct_migrated/Level-3/gemm.cpp | 0 .../02_sycl_dpct_migrated/Level-3/gemm3m.cpp | 0 .../Level-3/gemmBatched.cpp | 0 .../Level-3/gemmStridedBatched.cpp | 0 .../02_sycl_dpct_migrated/Level-3/hemm.cpp | 0 .../02_sycl_dpct_migrated/Level-3/her2k.cpp | 0 .../02_sycl_dpct_migrated/Level-3/herk.cpp | 0 .../02_sycl_dpct_migrated/Level-3/herkx.cpp | 0 .../02_sycl_dpct_migrated/Level-3/symm.cpp | 0 .../02_sycl_dpct_migrated/Level-3/syr2k.cpp | 0 .../02_sycl_dpct_migrated/Level-3/syrk.cpp | 0 .../02_sycl_dpct_migrated/Level-3/syrkx.cpp | 0 .../02_sycl_dpct_migrated/Level-3/trmm.cpp | 0 .../02_sycl_dpct_migrated/Level-3/trsm.cpp | 0 .../Level-3/trsmBatched.cpp | 0 .../CMakeLists.txt | 0 .../License.txt | 0 .../README.md | 0 .../sample.json | 0 .../third-party-programs.txt | 0 .../01_sycl_dpct_output/common/curand_utils.h | 0 ...rand_mrg32k3a_lognormal_example.cpp.dp.cpp | 0 .../curand_mrg32k3a_normal_example.cpp.dp.cpp | 0 ...curand_mrg32k3a_poisson_example.cpp.dp.cpp | 0 ...curand_mrg32k3a_uniform_example.cpp.dp.cpp | 0 .../01_sycl_dpct_output/mt19937/.gitignore | 0 ...urand_mt19937_lognormal_example.cpp.dp.cpp | 0 .../curand_mt19937_normal_example.cpp.dp.cpp | 0 .../curand_mt19937_poisson_example.cpp.dp.cpp | 0 .../curand_mt19937_uniform_example.cpp.dp.cpp | 0 .../01_sycl_dpct_output/mtgp32/.gitignore | 0 ...curand_mtgp32_lognormal_example.cpp.dp.cpp | 0 .../curand_mtgp32_normal_example.cpp.dp.cpp | 0 .../curand_mtgp32_poisson_example.cpp.dp.cpp | 0 .../curand_mtgp32_uniform_example.cpp.dp.cpp | 0 .../01_sycl_dpct_output/philox/.gitignore | 0 ...curand_philox_lognormal_example.cpp.dp.cpp | 0 .../curand_philox_normal_example.cpp.dp.cpp | 0 .../curand_philox_poisson_example.cpp.dp.cpp | 0 .../curand_philox_uniform_example.cpp.dp.cpp | 0 .../scrambled_sobol32/.gitignore | 0 ...mbled_sobol32_lognormal_example.cpp.dp.cpp | 0 ...crambled_sobol32_normal_example.cpp.dp.cpp | 0 ...rambled_sobol32_poisson_example.cpp.dp.cpp | 0 ...rambled_sobol32_uniform_example.cpp.dp.cpp | 0 .../scrambled_sobol64/.gitignore | 0 ...mbled_sobol64_lognormal_example.cpp.dp.cpp | 0 ...crambled_sobol64_normal_example.cpp.dp.cpp | 0 ...rambled_sobol64_poisson_example.cpp.dp.cpp | 0 ...rambled_sobol64_uniform_example.cpp.dp.cpp | 0 .../01_sycl_dpct_output/sobol32/.gitignore | 0 ...urand_sobol32_lognormal_example.cpp.dp.cpp | 0 .../curand_sobol32_normal_example.cpp.dp.cpp | 0 .../curand_sobol32_poisson_example.cpp.dp.cpp | 0 .../curand_sobol32_uniform_example.cpp.dp.cpp | 0 .../01_sycl_dpct_output/sobol64/.gitignore | 0 ...urand_sobol64_lognormal_example.cpp.dp.cpp | 0 .../curand_sobol64_normal_example.cpp.dp.cpp | 0 .../curand_sobol64_poisson_example.cpp.dp.cpp | 0 .../curand_sobol64_uniform_example.cpp.dp.cpp | 0 .../02_sycl_dpct_migrated/CMakeLists.txt | 0 .../Common/curand_utils.h | 0 .../mrg32k3a/CMakeLists.txt | 0 .../mrg32k3a/mrg32k3a_lognormal.cpp | 0 .../mrg32k3a/mrg32k3a_normal.cpp | 0 .../mrg32k3a/mrg32k3a_poisson.cpp | 0 .../mrg32k3a/mrg32k3a_uniform.cpp | 0 .../02_sycl_dpct_migrated/mt19937/.gitignore | 0 .../mt19937/CMakeLists.txt | 0 .../mt19937/mt19937_lognormal.cpp | 0 .../mt19937/mt19937_normal.cpp | 0 .../mt19937/mt19937_poisson.cpp | 0 .../mt19937/mt19937_uniform.cpp | 0 .../02_sycl_dpct_migrated/mtgp32/.gitignore | 0 .../mtgp32/CMakeLists.txt | 0 .../mtgp32/mtgp32_lognormal.cpp | 0 .../mtgp32/mtgp32_normal.cpp | 0 .../mtgp32/mtgp32_poisson.cpp | 0 .../mtgp32/mtgp32_uniform.cpp | 0 .../02_sycl_dpct_migrated/philox/.gitignore | 0 .../philox/CMakeLists.txt | 0 .../philox/philox_lognormal.cpp | 0 .../philox/philox_normal.cpp | 0 .../philox/philox_poisson.cpp | 0 .../philox/philox_uniform.cpp | 0 .../scrambled_sobol32/.gitignore | 0 .../scrambled_sobol32/CMakeLists.txt | 0 .../scrambled_sobol32_lognormal.cpp | 0 .../scrambled_sobol32_normal.cpp | 0 .../scrambled_sobol32_poisson.cpp | 0 .../scrambled_sobol32_uniform.cpp | 0 .../scrambled_sobol64/.gitignore | 0 .../scrambled_sobol64/CMakeLists.txt | 0 .../scrambled_sobol64_lognormal.cpp | 0 .../scrambled_sobol64_normal.cpp | 0 .../scrambled_sobol64_poisson.cpp | 0 .../scrambled_sobol64_uniform.cpp | 0 .../02_sycl_dpct_migrated/sobol32/.gitignore | 0 .../sobol32/CMakeLists.txt | 0 .../sobol32/sobol32_lognormal.cpp | 0 .../sobol32/sobol32_normal.cpp | 0 .../sobol32/sobol32_poisson.cpp | 0 .../sobol32/sobol32_uniform.cpp | 0 .../02_sycl_dpct_migrated/sobol64/.gitignore | 0 .../sobol64/CMakeLists.txt | 0 .../sobol64/sobol64_lognormal.cpp | 0 .../sobol64/sobol64_normal.cpp | 0 .../sobol64/sobol64_poisson.cpp | 0 .../sobol64/sobol64_uniform.cpp | 0 .../CMakeLists.txt | 0 .../License.txt | 0 .../README.md | 0 .../sample.json | 0 .../third-party-programs.txt | 0 .../01_dpct_output/CMakeLists.txt | 0 .../01_dpct_output/Common/helper_cuda.h | 0 .../01_dpct_output/Common/helper_cuda.h.yaml | 0 .../01_dpct_output/Common/helper_string.h | 0 .../simpleCUBLAS_LU.cpp.dp.cpp | 0 .../01_dpct_output/include/dpct/atomic.hpp | 0 .../include/dpct/blas_utils.hpp | 0 .../01_dpct_output/include/dpct/ccl_utils.hpp | 0 .../01_dpct_output/include/dpct/device.hpp | 0 .../include/dpct/dnnl_utils.hpp | 0 .../01_dpct_output/include/dpct/dpct.hpp | 0 .../include/dpct/dpl_extras/algorithm.h | 0 .../dpct/dpl_extras/dpcpp_extensions.h | 0 .../include/dpct/dpl_extras/functional.h | 0 .../include/dpct/dpl_extras/iterators.h | 0 .../include/dpct/dpl_extras/memory.h | 0 .../include/dpct/dpl_extras/numeric.h | 0 .../include/dpct/dpl_extras/vector.h | 0 .../01_dpct_output/include/dpct/dpl_utils.hpp | 0 .../01_dpct_output/include/dpct/fft_utils.hpp | 0 .../01_dpct_output/include/dpct/image.hpp | 0 .../01_dpct_output/include/dpct/kernel.hpp | 0 .../include/dpct/lapack_utils.hpp | 0 .../include/dpct/lib_common_utils.hpp | 0 .../01_dpct_output/include/dpct/math.hpp | 0 .../01_dpct_output/include/dpct/memory.hpp | 0 .../01_dpct_output/include/dpct/rng_utils.hpp | 0 .../include/dpct/sparse_utils.hpp | 0 .../01_dpct_output/include/dpct/util.hpp | 0 .../02_sycl_migrated/CMakeLists.txt | 0 .../02_sycl_migrated/Common/helper_cuda.h | 0 .../Common/helper_cuda.h.yaml | 0 .../02_sycl_migrated/Common/helper_string.h | 0 .../simpleCUBLAS_LU.cpp.dp.cpp | 0 .../02_sycl_migrated/include/dpct/atomic.hpp | 0 .../include/dpct/blas_utils.hpp | 0 .../include/dpct/ccl_utils.hpp | 0 .../02_sycl_migrated/include/dpct/device.hpp | 0 .../include/dpct/dnnl_utils.hpp | 0 .../02_sycl_migrated/include/dpct/dpct.hpp | 0 .../include/dpct/dpl_extras/algorithm.h | 0 .../dpct/dpl_extras/dpcpp_extensions.h | 0 .../include/dpct/dpl_extras/functional.h | 0 .../include/dpct/dpl_extras/iterators.h | 0 .../include/dpct/dpl_extras/memory.h | 0 .../include/dpct/dpl_extras/numeric.h | 0 .../include/dpct/dpl_extras/vector.h | 0 .../include/dpct/dpl_utils.hpp | 0 .../include/dpct/fft_utils.hpp | 0 .../02_sycl_migrated/include/dpct/image.hpp | 0 .../02_sycl_migrated/include/dpct/kernel.hpp | 0 .../include/dpct/lapack_utils.hpp | 0 .../include/dpct/lib_common_utils.hpp | 0 .../02_sycl_migrated/include/dpct/math.hpp | 0 .../02_sycl_migrated/include/dpct/memory.hpp | 0 .../include/dpct/rng_utils.hpp | 0 .../include/dpct/sparse_utils.hpp | 0 .../02_sycl_migrated/include/dpct/util.hpp | 0 .../CMakeLists.txt | 0 .../License.txt | 0 .../README.md | 0 .../sample.json | 0 .../third-party-programs.txt | 0 .../oneMKL/batched_linear_solver/README.md | 105 -- .../lu_solve_omp_offload.F90 | 193 ---- .../lu_solve_omp_offload_optimized.F90 | 189 ---- .../oneMKL/batched_linear_solver/makefile | 27 - .../oneMKL/batched_linear_solver/sample.json | 25 - .../third-party-programs.txt | 253 ----- Libraries/oneMKL/binomial/GNUmakefile | 13 - Libraries/oneMKL/binomial/README.md | 132 --- Libraries/oneMKL/binomial/makefile | 15 - Libraries/oneMKL/binomial/sample.json | 34 - Libraries/oneMKL/binomial/src/binomial.hpp | 75 -- .../oneMKL/binomial/src/binomial_main.cpp | 87 -- .../oneMKL/binomial/src/binomial_sycl.cpp | 202 ---- .../oneMKL/binomial/third-party-programs.txt | 253 ----- Libraries/oneMKL/black_scholes/GNUmakefile | 18 - Libraries/oneMKL/black_scholes/License.txt | 7 - Libraries/oneMKL/black_scholes/README.md | 132 --- Libraries/oneMKL/black_scholes/makefile | 15 - Libraries/oneMKL/black_scholes/sample.json | 34 - .../black_scholes/src/black_scholes.hpp | 132 --- .../black_scholes/src/black_scholes_sycl.cpp | 192 ---- .../black_scholes/third-party-programs.txt | 253 ----- .../block_cholesky_decomposition/GNUmakefile | 18 - .../block_cholesky_decomposition/License.txt | 7 - .../block_cholesky_decomposition/README.md | 123 --- .../block_cholesky_decomposition/auxi.cpp | 292 ------ .../block_cholesky_decomposition/dpbltrf.cpp | 173 ---- .../block_cholesky_decomposition/dpbltrs.cpp | 135 --- .../block_cholesky_decomposition/factor.cpp | 157 --- .../block_cholesky_decomposition/makefile | 16 - .../block_cholesky_decomposition/sample.json | 33 - .../block_cholesky_decomposition/solve.cpp | 182 ---- .../third-party-programs.txt | 253 ----- .../oneMKL/block_lu_decomposition/GNUmakefile | 18 - .../oneMKL/block_lu_decomposition/License.txt | 7 - .../oneMKL/block_lu_decomposition/README.md | 78 -- .../oneMKL/block_lu_decomposition/auxi.cpp | 304 ------ .../block_lu_decomposition/dgeblttrf.cpp | 382 ------- .../block_lu_decomposition/dgeblttrs.cpp | 176 ---- .../oneMKL/block_lu_decomposition/factor.cpp | 136 --- .../oneMKL/block_lu_decomposition/makefile | 16 - .../oneMKL/block_lu_decomposition/sample.json | 33 - .../oneMKL/block_lu_decomposition/solve.cpp | 154 --- .../third-party-programs.txt | 253 ----- .../oneMKL/computed_tomography/GNUmakefile | 20 - .../oneMKL/computed_tomography/License.txt | 7 - .../oneMKL/computed_tomography/README.md | 94 -- .../computed_tomography.cpp | 944 ------------------ .../oneMKL/computed_tomography/input.bmp | Bin 480054 -> 0 bytes Libraries/oneMKL/computed_tomography/makefile | 18 - .../oneMKL/computed_tomography/sample.json | 34 - .../third-party-programs.txt | 253 ----- .../oneMKL/fourier_correlation/GNUmakefile | 26 - .../oneMKL/fourier_correlation/License.txt | 7 - .../oneMKL/fourier_correlation/README.md | 128 --- .../fourier_correlation/fcorr_1d_buffers.cpp | 207 ---- .../fourier_correlation/fcorr_1d_usm.cpp | 207 ---- .../fourier_correlation/fcorr_2d_usm.cpp | 304 ------ Libraries/oneMKL/fourier_correlation/makefile | 27 - .../oneMKL/fourier_correlation/sample.json | 33 - .../third-party-programs.txt | 253 ----- .../License.txt | 7 - .../License.txt | 7 - Libraries/oneMKL/matrix_mul_mkl/GNUmakefile | 22 - Libraries/oneMKL/matrix_mul_mkl/License.txt | 7 - Libraries/oneMKL/matrix_mul_mkl/README.md | 113 --- Libraries/oneMKL/matrix_mul_mkl/makefile | 19 - .../oneMKL/matrix_mul_mkl/matrix_mul_mkl.cpp | 240 ----- Libraries/oneMKL/matrix_mul_mkl/sample.json | 34 - .../matrix_mul_mkl/third-party-programs.txt | 253 ----- Libraries/oneMKL/matrix_mul_mkl/utilities.hpp | 55 - .../monte_carlo_european_opt/GNUmakefile | 31 - .../monte_carlo_european_opt/License.txt | 7 - .../oneMKL/monte_carlo_european_opt/README.md | 141 --- .../oneMKL/monte_carlo_european_opt/makefile | 23 - .../monte_carlo_european_opt/sample.json | 34 - .../src/montecarlo.hpp | 100 -- .../src/montecarlo_main.cpp | 202 ---- .../monte_carlo_european_opt/src/timer.hpp | 20 - .../third-party-programs.txt | 253 ----- Libraries/oneMKL/monte_carlo_pi/GNUmakefile | 28 - Libraries/oneMKL/monte_carlo_pi/License.txt | 7 - Libraries/oneMKL/monte_carlo_pi/README.md | 118 --- Libraries/oneMKL/monte_carlo_pi/makefile | 26 - Libraries/oneMKL/monte_carlo_pi/mc_pi.cpp | 135 --- .../monte_carlo_pi/mc_pi_device_api.cpp | 132 --- Libraries/oneMKL/monte_carlo_pi/mc_pi_usm.cpp | 132 --- Libraries/oneMKL/monte_carlo_pi/sample.json | 33 - .../monte_carlo_pi/third-party-programs.txt | 253 ----- .../GNUmakefile | 28 - .../License.txt | 7 - .../README.md | 124 --- .../lottery.cpp | 156 --- .../lottery_device_api.cpp | 145 --- .../lottery_usm.cpp | 157 --- .../makefile | 37 - .../sample.json | 33 - .../third-party-programs.txt | 253 ----- .../sparse_conjugate_gradient/GNUmakefile | 24 - .../sparse_conjugate_gradient/License.txt | 7 - .../sparse_conjugate_gradient/README.md | 203 ---- .../oneMKL/sparse_conjugate_gradient/makefile | 23 - .../sparse_conjugate_gradient/sample.json | 33 - .../sparse_conjugate_gradient/sparse_cg.cpp | 592 ----------- .../sparse_conjugate_gradient/sparse_cg2.cpp | 655 ------------ .../third-party-programs.txt | 253 ----- .../sparse_conjugate_gradient/utils.hpp | 81 -- Libraries/oneMKL/student_t_test/GNUmakefile | 24 - Libraries/oneMKL/student_t_test/License.txt | 7 - Libraries/oneMKL/student_t_test/README.md | 93 -- Libraries/oneMKL/student_t_test/makefile | 22 - Libraries/oneMKL/student_t_test/sample.json | 33 - Libraries/oneMKL/student_t_test/t_test.cpp | 207 ---- .../oneMKL/student_t_test/t_test_usm.cpp | 210 ---- .../student_t_test/third-party-programs.txt | 253 ----- 432 files changed, 3 insertions(+), 13986 deletions(-) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/01_dpct_output/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/01_dpct_output/MainSourceFiles.yaml (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/01_dpct_output/longstaff_schwartz_svd_2.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/MainSourceFiles.yaml (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/atomic.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/bindless_images.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_gemm_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/ccl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/codepin.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/serialization/basic.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/compat_service.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/device.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dnnl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpct.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/algorithm.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/dpcpp_extensions.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/functional.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterator_adaptor.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterators.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/memory.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/numeric.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/vector.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/fft_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/graph.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/group_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/image.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/kernel.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lapack_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lib_common_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/math.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/memory.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/rng_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/sparse_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/util.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/longstaff_schwartz_svd_2.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/CMakeLists.txt (100%) rename {Libraries/oneMKL/batched_linear_solver => DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration}/License.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/README.md (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/sample.json (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/src/longstaff_schwartz_svd_2.cu (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_american_options_SYCLmigration/third-party-programs.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Common/cublas_utils.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amax_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amin_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_asum_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_axpy_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_copy_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dot_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dotc_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_nrm2_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rot_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotg_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotm_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotmg_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_scal_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_swap_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gbmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gemv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_ger_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hbmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hemv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her2_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr2_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_sbmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr2_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_symv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr2_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbsv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpsv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trmv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trsv_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm3m_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmBatched_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmStridedBatched_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_hemm_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_her2k_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herk_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herkx_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_symm_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syr2k_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrk_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrkx_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trmm_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsmBatched_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsm_example.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Common/cublas_utils.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amax.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amin.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/asum.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/axpy.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/copy.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dot.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dotc.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/nrm2.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rot.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotg.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotm.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotmg.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/scal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/swap.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gbmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gemv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/ger.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hbmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hemv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her2.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr2.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/sbmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr2.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/symv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr2.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbsv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpsv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trmv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trsv.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm3m.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmBatched.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmStridedBatched.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/hemm.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/her2k.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herk.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herkx.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/symm.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syr2k.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrk.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrkx.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trmm.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsm.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsmBatched.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/License.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/README.md (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/sample.json (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuBLAS_examples_SYCLMigration/third-party-programs.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/common/curand_utils.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_lognormal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_normal_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_poisson_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_uniform_example.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/Common/curand_utils.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/.gitignore (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_lognormal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_normal.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_poisson.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_uniform.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/License.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/README.md (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/sample.json (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_cuRAND_examples_SYCLMigration/third-party-programs.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h.yaml (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_string.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/atomic.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/blas_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/ccl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/device.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dnnl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpct.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/algorithm.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/dpcpp_extensions.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/functional.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/iterators.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/memory.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/numeric.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/vector.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/fft_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/image.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/kernel.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lapack_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lib_common_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/math.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/memory.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/rng_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/sparse_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/util.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/CMakeLists.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h.yaml (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_string.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/atomic.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/blas_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/ccl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/device.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dnnl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpct.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/algorithm.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/dpcpp_extensions.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/functional.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/iterators.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/memory.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/numeric.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/vector.h (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/fft_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/image.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/kernel.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lapack_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lib_common_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/math.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/memory.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/rng_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/sparse_utils.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/util.hpp (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/CMakeLists.txt (100%) rename {Libraries/oneMKL/binomial => DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration}/License.txt (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/README.md (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/sample.json (100%) rename {Libraries/oneMKL => DirectProgramming/C++SYCL/SYCLMigration}/guided_simpleCUBLAS_LU_SYCLMigration/third-party-programs.txt (100%) delete mode 100644 Libraries/oneMKL/batched_linear_solver/README.md delete mode 100644 Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload.F90 delete mode 100644 Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload_optimized.F90 delete mode 100644 Libraries/oneMKL/batched_linear_solver/makefile delete mode 100644 Libraries/oneMKL/batched_linear_solver/sample.json delete mode 100644 Libraries/oneMKL/batched_linear_solver/third-party-programs.txt delete mode 100644 Libraries/oneMKL/binomial/GNUmakefile delete mode 100644 Libraries/oneMKL/binomial/README.md delete mode 100644 Libraries/oneMKL/binomial/makefile delete mode 100644 Libraries/oneMKL/binomial/sample.json delete mode 100644 Libraries/oneMKL/binomial/src/binomial.hpp delete mode 100644 Libraries/oneMKL/binomial/src/binomial_main.cpp delete mode 100644 Libraries/oneMKL/binomial/src/binomial_sycl.cpp delete mode 100644 Libraries/oneMKL/binomial/third-party-programs.txt delete mode 100644 Libraries/oneMKL/black_scholes/GNUmakefile delete mode 100644 Libraries/oneMKL/black_scholes/License.txt delete mode 100644 Libraries/oneMKL/black_scholes/README.md delete mode 100644 Libraries/oneMKL/black_scholes/makefile delete mode 100644 Libraries/oneMKL/black_scholes/sample.json delete mode 100644 Libraries/oneMKL/black_scholes/src/black_scholes.hpp delete mode 100644 Libraries/oneMKL/black_scholes/src/black_scholes_sycl.cpp delete mode 100644 Libraries/oneMKL/black_scholes/third-party-programs.txt delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/GNUmakefile delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/License.txt delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/README.md delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/auxi.cpp delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/dpbltrf.cpp delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/dpbltrs.cpp delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/factor.cpp delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/makefile delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/sample.json delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/solve.cpp delete mode 100644 Libraries/oneMKL/block_cholesky_decomposition/third-party-programs.txt delete mode 100644 Libraries/oneMKL/block_lu_decomposition/GNUmakefile delete mode 100644 Libraries/oneMKL/block_lu_decomposition/License.txt delete mode 100644 Libraries/oneMKL/block_lu_decomposition/README.md delete mode 100644 Libraries/oneMKL/block_lu_decomposition/auxi.cpp delete mode 100644 Libraries/oneMKL/block_lu_decomposition/dgeblttrf.cpp delete mode 100644 Libraries/oneMKL/block_lu_decomposition/dgeblttrs.cpp delete mode 100644 Libraries/oneMKL/block_lu_decomposition/factor.cpp delete mode 100644 Libraries/oneMKL/block_lu_decomposition/makefile delete mode 100644 Libraries/oneMKL/block_lu_decomposition/sample.json delete mode 100644 Libraries/oneMKL/block_lu_decomposition/solve.cpp delete mode 100644 Libraries/oneMKL/block_lu_decomposition/third-party-programs.txt delete mode 100644 Libraries/oneMKL/computed_tomography/GNUmakefile delete mode 100644 Libraries/oneMKL/computed_tomography/License.txt delete mode 100644 Libraries/oneMKL/computed_tomography/README.md delete mode 100644 Libraries/oneMKL/computed_tomography/computed_tomography.cpp delete mode 100644 Libraries/oneMKL/computed_tomography/input.bmp delete mode 100644 Libraries/oneMKL/computed_tomography/makefile delete mode 100644 Libraries/oneMKL/computed_tomography/sample.json delete mode 100644 Libraries/oneMKL/computed_tomography/third-party-programs.txt delete mode 100644 Libraries/oneMKL/fourier_correlation/GNUmakefile delete mode 100644 Libraries/oneMKL/fourier_correlation/License.txt delete mode 100644 Libraries/oneMKL/fourier_correlation/README.md delete mode 100644 Libraries/oneMKL/fourier_correlation/fcorr_1d_buffers.cpp delete mode 100644 Libraries/oneMKL/fourier_correlation/fcorr_1d_usm.cpp delete mode 100644 Libraries/oneMKL/fourier_correlation/fcorr_2d_usm.cpp delete mode 100644 Libraries/oneMKL/fourier_correlation/makefile delete mode 100644 Libraries/oneMKL/fourier_correlation/sample.json delete mode 100644 Libraries/oneMKL/fourier_correlation/third-party-programs.txt delete mode 100644 Libraries/oneMKL/guided_american_options_SYCLmigration/License.txt delete mode 100644 Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/License.txt delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/GNUmakefile delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/License.txt delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/README.md delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/makefile delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/matrix_mul_mkl.cpp delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/sample.json delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/third-party-programs.txt delete mode 100644 Libraries/oneMKL/matrix_mul_mkl/utilities.hpp delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/GNUmakefile delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/License.txt delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/README.md delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/makefile delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/sample.json delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo.hpp delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo_main.cpp delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/src/timer.hpp delete mode 100644 Libraries/oneMKL/monte_carlo_european_opt/third-party-programs.txt delete mode 100644 Libraries/oneMKL/monte_carlo_pi/GNUmakefile delete mode 100644 Libraries/oneMKL/monte_carlo_pi/License.txt delete mode 100644 Libraries/oneMKL/monte_carlo_pi/README.md delete mode 100644 Libraries/oneMKL/monte_carlo_pi/makefile delete mode 100644 Libraries/oneMKL/monte_carlo_pi/mc_pi.cpp delete mode 100644 Libraries/oneMKL/monte_carlo_pi/mc_pi_device_api.cpp delete mode 100644 Libraries/oneMKL/monte_carlo_pi/mc_pi_usm.cpp delete mode 100644 Libraries/oneMKL/monte_carlo_pi/sample.json delete mode 100644 Libraries/oneMKL/monte_carlo_pi/third-party-programs.txt delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/GNUmakefile delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/License.txt delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/README.md delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/lottery.cpp delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/lottery_device_api.cpp delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/lottery_usm.cpp delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/makefile delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/sample.json delete mode 100644 Libraries/oneMKL/random_sampling_without_replacement/third-party-programs.txt delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/GNUmakefile delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/License.txt delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/README.md delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/makefile delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/sample.json delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/third-party-programs.txt delete mode 100644 Libraries/oneMKL/sparse_conjugate_gradient/utils.hpp delete mode 100644 Libraries/oneMKL/student_t_test/GNUmakefile delete mode 100644 Libraries/oneMKL/student_t_test/License.txt delete mode 100644 Libraries/oneMKL/student_t_test/README.md delete mode 100644 Libraries/oneMKL/student_t_test/makefile delete mode 100644 Libraries/oneMKL/student_t_test/sample.json delete mode 100644 Libraries/oneMKL/student_t_test/t_test.cpp delete mode 100644 Libraries/oneMKL/student_t_test/t_test_usm.cpp delete mode 100644 Libraries/oneMKL/student_t_test/third-party-programs.txt diff --git a/.gitmodules b/.gitmodules index e69de29bb2..d07085d98e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Libraries/oneMKL"] + path = Libraries/oneMKL + url = https://github.com/oneapi-src/oneMKL-samples.git diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/01_dpct_output/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/01_dpct_output/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/01_dpct_output/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/01_dpct_output/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/01_dpct_output/MainSourceFiles.yaml b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/01_dpct_output/MainSourceFiles.yaml similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/01_dpct_output/MainSourceFiles.yaml rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/01_dpct_output/MainSourceFiles.yaml diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/01_dpct_output/longstaff_schwartz_svd_2.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/01_dpct_output/longstaff_schwartz_svd_2.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/01_dpct_output/longstaff_schwartz_svd_2.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/01_dpct_output/longstaff_schwartz_svd_2.dp.cpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/MainSourceFiles.yaml b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/MainSourceFiles.yaml similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/MainSourceFiles.yaml rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/MainSourceFiles.yaml diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/atomic.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/atomic.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/atomic.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/atomic.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/bindless_images.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/bindless_images.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/bindless_images.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/bindless_images.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_gemm_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_gemm_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_gemm_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_gemm_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/blas_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/ccl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/ccl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/ccl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/ccl_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/codepin.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/codepin.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/codepin.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/codepin.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/serialization/basic.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/serialization/basic.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/serialization/basic.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/codepin/serialization/basic.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/compat_service.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/compat_service.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/compat_service.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/compat_service.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/device.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/device.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/device.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/device.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dnnl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dnnl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dnnl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dnnl_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpct.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpct.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpct.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpct.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/algorithm.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/algorithm.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/algorithm.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/algorithm.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/dpcpp_extensions.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/dpcpp_extensions.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/dpcpp_extensions.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/dpcpp_extensions.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/functional.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/functional.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/functional.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/functional.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterator_adaptor.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterator_adaptor.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterator_adaptor.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterator_adaptor.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterators.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterators.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterators.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/iterators.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/memory.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/memory.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/memory.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/memory.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/numeric.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/numeric.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/numeric.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/numeric.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/vector.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/vector.h similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/vector.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_extras/vector.h diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/dpl_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/fft_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/fft_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/fft_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/fft_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/graph.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/graph.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/graph.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/graph.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/group_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/group_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/group_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/group_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/image.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/image.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/image.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/image.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/kernel.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/kernel.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/kernel.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/kernel.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lapack_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lapack_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lapack_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lapack_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lib_common_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lib_common_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lib_common_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/lib_common_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/math.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/math.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/math.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/math.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/memory.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/memory.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/memory.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/memory.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/rng_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/rng_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/rng_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/rng_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/sparse_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/sparse_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/sparse_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/sparse_utils.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/util.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/util.hpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/util.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/include/dpct/util.hpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/longstaff_schwartz_svd_2.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/longstaff_schwartz_svd_2.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/longstaff_schwartz_svd_2.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/02_sycl_migrated_optimized/longstaff_schwartz_svd_2.dp.cpp diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/CMakeLists.txt diff --git a/Libraries/oneMKL/batched_linear_solver/License.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/License.txt similarity index 100% rename from Libraries/oneMKL/batched_linear_solver/License.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/License.txt diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/README.md b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/README.md similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/README.md rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/README.md diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/sample.json b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/sample.json similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/sample.json rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/sample.json diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/src/longstaff_schwartz_svd_2.cu b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/src/longstaff_schwartz_svd_2.cu similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/src/longstaff_schwartz_svd_2.cu rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/src/longstaff_schwartz_svd_2.cu diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/third-party-programs.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/third-party-programs.txt similarity index 100% rename from Libraries/oneMKL/guided_american_options_SYCLmigration/third-party-programs.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_american_options_SYCLmigration/third-party-programs.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Common/cublas_utils.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Common/cublas_utils.h similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Common/cublas_utils.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Common/cublas_utils.h diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amax_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amax_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amax_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amax_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amin_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amin_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amin_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_amin_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_asum_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_asum_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_asum_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_asum_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_axpy_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_axpy_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_axpy_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_axpy_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_copy_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_copy_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_copy_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_copy_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dot_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dot_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dot_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dot_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dotc_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dotc_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dotc_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_dotc_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_nrm2_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_nrm2_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_nrm2_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_nrm2_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rot_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rot_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rot_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rot_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotg_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotg_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotg_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotg_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotm_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotm_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotm_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotm_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotmg_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotmg_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotmg_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_rotmg_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_scal_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_scal_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_scal_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_scal_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_swap_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_swap_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_swap_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-1/cublas_swap_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gbmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gbmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gbmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gbmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gemv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gemv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gemv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_gemv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_ger_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_ger_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_ger_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_ger_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hbmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hbmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hbmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hbmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hemv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hemv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hemv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hemv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her2_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her2_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her2_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her2_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_her_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr2_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr2_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr2_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr2_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_hpr_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_sbmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_sbmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_sbmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_sbmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr2_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr2_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr2_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr2_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_spr_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_symv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_symv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_symv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_symv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr2_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr2_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr2_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr2_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_syr_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbsv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbsv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbsv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tbsv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpsv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpsv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpsv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_tpsv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trmv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trmv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trmv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trmv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trsv_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trsv_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trsv_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-2/cublas_trsv_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm3m_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm3m_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm3m_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm3m_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmBatched_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmBatched_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmBatched_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmBatched_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmStridedBatched_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmStridedBatched_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmStridedBatched_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemmStridedBatched_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_gemm_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_hemm_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_hemm_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_hemm_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_hemm_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_her2k_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_her2k_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_her2k_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_her2k_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herk_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herk_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herk_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herk_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herkx_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herkx_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herkx_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_herkx_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_symm_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_symm_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_symm_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_symm_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syr2k_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syr2k_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syr2k_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syr2k_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrk_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrk_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrk_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrk_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrkx_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrkx_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrkx_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_syrkx_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trmm_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trmm_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trmm_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trmm_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsmBatched_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsmBatched_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsmBatched_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsmBatched_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsm_example.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsm_example.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsm_example.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/01_sycl_dpct_output/Level-3/cublas_trsm_example.dp.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Common/cublas_utils.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Common/cublas_utils.h similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Common/cublas_utils.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Common/cublas_utils.h diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amax.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amax.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amax.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amax.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amin.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amin.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amin.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/amin.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/asum.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/asum.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/asum.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/asum.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/axpy.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/axpy.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/axpy.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/axpy.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/copy.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/copy.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/copy.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/copy.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dot.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dot.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dot.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dot.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dotc.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dotc.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dotc.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/dotc.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/nrm2.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/nrm2.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/nrm2.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/nrm2.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rot.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rot.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rot.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rot.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotg.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotg.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotg.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotg.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotm.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotm.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotm.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotm.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotmg.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotmg.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotmg.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/rotmg.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/scal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/scal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/scal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/scal.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/swap.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/swap.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/swap.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-1/swap.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gbmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gbmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gbmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gbmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gemv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gemv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gemv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/gemv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/ger.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/ger.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/ger.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/ger.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hbmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hbmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hbmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hbmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hemv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hemv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hemv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hemv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her2.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her2.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her2.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/her2.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr2.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr2.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr2.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/hpr2.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/sbmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/sbmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/sbmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/sbmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr2.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr2.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr2.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/spr2.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/symv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/symv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/symv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/symv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr2.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr2.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr2.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/syr2.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbsv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbsv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbsv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tbsv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpsv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpsv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpsv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/tpsv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trmv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trmv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trmv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trmv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trsv.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trsv.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trsv.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-2/trsv.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm3m.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm3m.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm3m.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemm3m.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmBatched.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmBatched.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmBatched.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmBatched.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmStridedBatched.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmStridedBatched.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmStridedBatched.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/gemmStridedBatched.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/hemm.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/hemm.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/hemm.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/hemm.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/her2k.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/her2k.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/her2k.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/her2k.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herk.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herk.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herk.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herk.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herkx.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herkx.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herkx.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/herkx.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/symm.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/symm.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/symm.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/symm.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syr2k.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syr2k.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syr2k.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syr2k.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrk.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrk.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrk.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrk.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrkx.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrkx.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrkx.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/syrkx.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trmm.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trmm.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trmm.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trmm.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsm.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsm.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsm.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsm.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsmBatched.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsmBatched.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsmBatched.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/02_sycl_dpct_migrated/Level-3/trsmBatched.cpp diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/License.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/License.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/License.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/License.txt diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/README.md b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/README.md similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/README.md rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/README.md diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/sample.json b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/sample.json similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/sample.json rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/sample.json diff --git a/Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/third-party-programs.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/third-party-programs.txt similarity index 100% rename from Libraries/oneMKL/guided_cuBLAS_examples_SYCLMigration/third-party-programs.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuBLAS_examples_SYCLMigration/third-party-programs.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/common/curand_utils.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/common/curand_utils.h similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/common/curand_utils.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/common/curand_utils.h diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mrg32k3a/curand_mrg32k3a_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mt19937/curand_mt19937_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/mtgp32/curand_mtgp32_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/philox/curand_philox_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol32/curand_scrambled_sobol32_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/scrambled_sobol64/curand_scrambled_sobol64_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol32/curand_sobol32_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_lognormal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_lognormal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_lognormal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_lognormal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_normal_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_normal_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_normal_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_normal_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_poisson_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_poisson_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_poisson_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_poisson_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_uniform_example.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_uniform_example.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_uniform_example.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/01_sycl_dpct_output/sobol64/curand_sobol64_uniform_example.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/Common/curand_utils.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/Common/curand_utils.h similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/Common/curand_utils.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/Common/curand_utils.h diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mrg32k3a/mrg32k3a_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mt19937/mt19937_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/mtgp32/mtgp32_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/philox/philox_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol32/scrambled_sobol32_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/scrambled_sobol64/scrambled_sobol64_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol32/sobol32_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/.gitignore b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/.gitignore similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/.gitignore rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/.gitignore diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_lognormal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_lognormal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_lognormal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_lognormal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_normal.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_normal.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_normal.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_normal.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_poisson.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_poisson.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_poisson.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_poisson.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_uniform.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_uniform.cpp similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_uniform.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/02_sycl_dpct_migrated/sobol64/sobol64_uniform.cpp diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/License.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/License.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/License.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/License.txt diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/README.md b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/README.md similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/README.md rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/README.md diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/sample.json b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/sample.json similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/sample.json rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/sample.json diff --git a/Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/third-party-programs.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/third-party-programs.txt similarity index 100% rename from Libraries/oneMKL/guided_cuRAND_examples_SYCLMigration/third-party-programs.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_cuRAND_examples_SYCLMigration/third-party-programs.txt diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h.yaml b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h.yaml similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h.yaml rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_cuda.h.yaml diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_string.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_string.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_string.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Common/helper_string.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/atomic.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/atomic.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/atomic.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/atomic.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/blas_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/blas_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/blas_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/blas_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/ccl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/ccl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/ccl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/ccl_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/device.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/device.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/device.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/device.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dnnl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dnnl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dnnl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dnnl_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpct.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpct.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpct.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpct.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/algorithm.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/algorithm.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/algorithm.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/algorithm.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/dpcpp_extensions.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/dpcpp_extensions.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/dpcpp_extensions.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/dpcpp_extensions.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/functional.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/functional.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/functional.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/functional.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/iterators.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/iterators.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/iterators.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/iterators.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/memory.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/memory.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/memory.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/memory.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/numeric.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/numeric.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/numeric.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/numeric.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/vector.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/vector.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/vector.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_extras/vector.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/dpl_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/fft_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/fft_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/fft_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/fft_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/image.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/image.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/image.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/image.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/kernel.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/kernel.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/kernel.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/kernel.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lapack_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lapack_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lapack_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lapack_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lib_common_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lib_common_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lib_common_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/lib_common_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/math.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/math.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/math.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/math.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/memory.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/memory.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/memory.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/memory.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/rng_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/rng_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/rng_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/rng_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/sparse_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/sparse_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/sparse_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/sparse_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/util.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/util.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/util.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/01_dpct_output/include/dpct/util.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/CMakeLists.txt diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h.yaml b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h.yaml similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h.yaml rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_cuda.h.yaml diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_string.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_string.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_string.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Common/helper_string.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/simpleCUBLAS_LU.cpp.dp.cpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/atomic.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/atomic.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/atomic.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/atomic.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/blas_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/blas_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/blas_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/blas_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/ccl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/ccl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/ccl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/ccl_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/device.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/device.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/device.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/device.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dnnl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dnnl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dnnl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dnnl_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpct.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpct.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpct.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpct.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/algorithm.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/algorithm.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/algorithm.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/algorithm.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/dpcpp_extensions.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/dpcpp_extensions.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/dpcpp_extensions.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/dpcpp_extensions.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/functional.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/functional.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/functional.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/functional.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/iterators.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/iterators.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/iterators.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/iterators.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/memory.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/memory.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/memory.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/memory.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/numeric.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/numeric.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/numeric.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/numeric.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/vector.h b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/vector.h similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/vector.h rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_extras/vector.h diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/dpl_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/fft_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/fft_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/fft_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/fft_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/image.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/image.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/image.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/image.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/kernel.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/kernel.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/kernel.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/kernel.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lapack_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lapack_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lapack_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lapack_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lib_common_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lib_common_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lib_common_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/lib_common_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/math.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/math.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/math.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/math.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/memory.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/memory.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/memory.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/memory.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/rng_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/rng_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/rng_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/rng_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/sparse_utils.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/sparse_utils.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/sparse_utils.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/sparse_utils.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/util.hpp b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/util.hpp similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/util.hpp rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/02_sycl_migrated/include/dpct/util.hpp diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/CMakeLists.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/CMakeLists.txt similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/CMakeLists.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/CMakeLists.txt diff --git a/Libraries/oneMKL/binomial/License.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/License.txt similarity index 100% rename from Libraries/oneMKL/binomial/License.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/License.txt diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/README.md b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/README.md similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/README.md rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/README.md diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/sample.json b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/sample.json similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/sample.json rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/sample.json diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/third-party-programs.txt b/DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/third-party-programs.txt similarity index 100% rename from Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/third-party-programs.txt rename to DirectProgramming/C++SYCL/SYCLMigration/guided_simpleCUBLAS_LU_SYCLMigration/third-party-programs.txt diff --git a/Libraries/oneMKL/batched_linear_solver/README.md b/Libraries/oneMKL/batched_linear_solver/README.md deleted file mode 100644 index 64b6b5139b..0000000000 --- a/Libraries/oneMKL/batched_linear_solver/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# Batched Linear Solver Sample -Solving a batch of linear systems is a common operation in engineering and scientific computing. -Consequently, the oneMKL LAPACK implementation provides batched LU solver functions that are optimized -for Intel processors. - -For more information on oneMKL, and complete documentation of all oneMKL routines, see https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04 -| Hardware | Intel® Skylake with Gen9 or newer -| Software | Intel® oneMKL, Intel® Fortran Compiler -| What you will learn | How to optimize host-device data transfer when using OpenMP target offload -| Time to complete | 45 minutes - -## Purpose -This sample shows how to solve a batch of linear systems using the batched solver functions -([``getrf_batch_strided``](https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-fortran/2023-1/getrf-batch-strided.html) and [``getrs_batch_strided``](https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-fortran/2023-1/getrs-batch-strided.html)), how to offload these functions to an accelerator using the OpenMP target directives, and how to minimize host-device data transfer to achieve better performance. The following article provides more detailed descriptions of the sample codes: [Solving Linear Systems Using oneMKL and OpenMP Target Offloading](https://www.intel.com/content/www/us/en/developer/articles/technical/solve-linear-systems-onemkl-openmp-target-offload.html). - -## Key Implementation Details -In general, the factored matrices and pivots can be discarded after the linear systems are solved. Only the solutions -need to be transferred back to the host. Two sample codes are provided: `lu_solve_omp_offload.F90` and -`lu_solve_omp_offload_optimized.F90`. The first shows a straightforward way to -dispatch the LU factorization and solver functions using two OpenMP target regions. The code gives correct results -but performs some unnecessary host-device data transfer. The second sample code fuses the two OpenMP regions to -improve performance by minimizing data transfer. - -## License -Code samples are licensed under the MIT license. See [License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt). - -## Building and Running the Batched Linear Solver Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux Sudo: . /opt/intel/oneapi/setvars.sh -> -> Linux User: . ~/intel/oneapi/setvars.sh -> ->For more information on environment variables, see [Use the setvars Script for Linux or macOS](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html). - -Run `make` to build and run the sample. Three programs are generated: - -1. `lu_solve`: CPU-only, OpenMP disabled -2. `lu_solve_omp_offload`: two OpenMP target regions with accelerator offload enabled -3. `lu_solve_omp_offload_optimized`: one OpenMP target offload region to minimize host-device data transfer - -Note that the makefile only runs small tests to verify that the executables are working correctly. The problem sizes are too small to justify accelerator offload. Use the following command-line options to run the tests shown in [Solving Linear Systems Using oneMKL and OpenMP Target Offloading](https://www.intel.com/content/www/us/en/developer/articles/technical/solve-linear-systems-onemkl-openmp-target-offload.html): `-n 16000 -b 8 -r 1 -c 5`. - -> **Note**: By default this makefile will be executable on devices with double precision support (fp64). -> To execute on devices with only single precision support(e.g., gen11, gen12) include `-DSP` option as follows in makefile -> -> ``` -> IFX_OPTS_OFFLOAD = -DSP -DMKL_ILP64 -qopenmp -fopenmp-targets=spir64 -fsycl -L${MKLROOT}/lib/intel64 -lmkl_sycl - ->lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -ldl -> ``` -> - -You can remove all generated files with `make clean`. - -### Example of Output -If everything is working correctly, the output should be similar to this: -``` -u172874@s001-n157:~/oneAPI-samples/Libraries/oneMKL/batched_linear_solver$ make -ifx lu_solve_omp_offload.F90 -o lu_solve -i8 -free -qmkl -ifx lu_solve_omp_offload.F90 -o lu_solve_omp_offload -i8 -free -qmkl -DMKL_ILP64 -qopenmp -fopenmp-targets=spir64 -qmkl-sycl-impl=lapack -ifx lu_solve_omp_offload_optimized.F90 -o lu_solve_omp_offload_optimized -i8 -free -qmkl -DMKL_ILP64 -qopenmp -fopenmp-targets=spir64 -qmkl-sycl-impl=lapack -./lu_solve -n 64 -b 8 -r 1 -c 2 - Matrix dimensions: 64 - Batch size: 8 - Number of RHS: 1 - Number of test cycles: 2 - Computation completed successfully 2.849000000000000E-002 seconds - Computation completed successfully 4.600000000000000E-005 seconds - Total time: 2.853600000000000E-002 seconds -./lu_solve_omp_offload -n 64 -b 8 -r 1 -c 2 - Matrix dimensions: 64 - Batch size: 8 - Number of RHS: 1 - Number of test cycles: 2 - Computation completed successfully 1.52985400000000 seconds - Computation completed successfully 1.212700000000000E-002 seconds - Total time: 1.54198100000000 seconds -./lu_solve_omp_offload_optimized -n 64 -b 8 -r 1 -c 2 - Matrix dimensions: 64 - Batch size: 8 - Number of RHS: 1 - Number of test cycles: 2 - Computation completed successfully 1.54803900000000 seconds - Computation completed successfully 1.202200000000000E-002 seconds - Total time: 1.56006100000000 seconds -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload.F90 b/Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload.F90 deleted file mode 100644 index 4fad5b4b40..0000000000 --- a/Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload.F90 +++ /dev/null @@ -1,193 +0,0 @@ -!=============================================================================== -! Copyright 2021-2022 Intel Corporation. -! -! This software and the related documents are Intel copyrighted materials, and -! your use of them is governed by the express license under which they were -! provided to you (License). Unless the License provides otherwise, you may not -! use, modify, copy, publish, distribute, disclose or transmit this software or -! the related documents without Intel's prior written permission. -! -! This software and the related documents are provided as is, with no express -! or implied warranties, other than those that are expressly stated in the -! License. -!=============================================================================== -! -! Content: -! Intel(R) oneAPI Math Kernel Library (oneMKL) -! FORTRAN OpenMP offload examples for solving batched linear systems. -! -! Compile for CPU: -! ifx -i8 -qmkl -free \ -! lu_solve_omp_offload_ex1_timer.F90 -o lu_solve_ex1_timer -! -! Compile for GPU: -! ifx -i8 -DMKL_ILP64 -qopenmp -fopenmp-targets=spir64 -free \ -! -qmkl -qmkl-sycl-impl=lapack \ -! lu_solve_omp_offload_ex1_timer.F90 -o lu_solve_ex1_omp_timer -! -! Compile with -DSP to use single precision instead of double precision. -! -!******************************************************************************* - -!$ include "mkl_omp_offload.f90" - -program solve_batched_linear_systems - -! Decide whether to use 32- or 64-bit integer type -#if defined(MKL_ILP64) -!$ use onemkl_lapack_omp_offload_ilp64 ! 64-bit -#else -!$ use onemkl_lapack_omp_offload_lp64 ! 32-bit -#endif - - implicit none - - integer :: n = 64, batch_size = 4096, nrhs = 1, cycles = 5 - integer :: lda, stride_a, stride_ipiv - integer :: ldb, stride_b - integer, allocatable :: ipiv(:,:), info(:) - -#if defined(SP) - real (kind=4), allocatable :: a(:,:), b(:,:), a_orig(:,:), b_orig(:,:), x(:) - real (kind=4) :: residual, threshold = 1.0e-5 -#else - real (kind=8), allocatable :: a(:,:), b(:,:), a_orig(:,:), b_orig(:,:), x(:) - real (kind=8) :: residual, threshold = 1.0d-9 -#endif - - integer (kind=8) :: start_time, end_time, clock_precision - real (kind=8) :: cycle_time, total_time = 0.0d0 - - integer :: i, j, c, allocstat, stat - character (len = 132) :: allocmsg - character (len = 32) :: arg1, arg2 - - ! Simple command-line parser with no error checks - do i = 1, command_argument_count(), 2 - call get_command_argument(i, arg1) - select case (arg1) - case ('-n') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) n - case ('-b') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) batch_size - case ('-r') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) nrhs - case ('-c') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) cycles - case default - print *, 'Unrecognized command-line option:', arg1 - stop - end select - enddo - print *, 'Matrix dimensions:', n - print *, 'Batch size:', batch_size - print *, 'Number of RHS:', nrhs - print *, 'Number of test cycles:', cycles - - lda = n - stride_a = n * lda - stride_ipiv = n - ldb = n - stride_b = n * nrhs - - ! Allocate memory for linear algebra computations - allocate (a(stride_a, batch_size), b(n, batch_size*nrhs), & - ipiv(stride_ipiv, batch_size), info(batch_size), & - stat = allocstat, errmsg = allocmsg) - if (allocstat > 0) stop trim(allocmsg) - - ! Allocate memory for error checking - allocate (a_orig(stride_a, batch_size), b_orig(n, batch_size*nrhs), x(n), & - stat = allocstat, errmsg = allocmsg) - if (allocstat > 0) stop trim(allocmsg) - - call system_clock(count_rate = clock_precision) - call random_seed() - - do c = 1, cycles - ! Initialize the matrices with a random number in the interval (-0.5, 0.5) - call random_number(a) - a = 0.5 - a - ! Make diagonal band values larger to ensure well-conditioned matrices - do i = 1, n - a(i+(i-1)*lda,:) = a(i+(i-1)*lda,:) + 50.0 - if (i .ne. 1) a(i+(i-1)*lda-1,:) = a(i+(i-1)*lda-1,:) + 20.0 - if (i .ne. n) a(i+(i-1)*lda+1,:) = a(i+(i-1)*lda+1,:) + 20.0 - enddo - - ! Initialize the RHS with a random number in the interval (-2.5, 2.5) - call random_number(b) - b = 2.5 - (5.0 * b) - a_orig = a - b_orig = b - - call system_clock(start_time) ! Start timer - - ! Compute the LU factorizations and solve the linear systems using OpenMP offload. - ! On entry, "a" contains the input matrices. On exit, it contains the factored matrices. - !$omp target data map(tofrom:a) map(from:ipiv) map(from:info) - !$omp dispatch -#if defined(SP) - call sgetrf_batch_strided(n, n, a, lda, stride_a, ipiv, stride_ipiv, batch_size, info) -#else - call dgetrf_batch_strided(n, n, a, lda, stride_a, ipiv, stride_ipiv, batch_size, info) -#endif - !$omp end target data - - if (any(info .ne. 0)) then - print *, 'Error: getrf_batch_strided returned with errors.' - stop - else - ! Solving the linear systems. On exit, the solutions are stored in b. - !$omp target data map(to:a) map(to:ipiv) map(tofrom: b) map(from:info) - !$omp dispatch -#if defined(SP) - call sgetrs_batch_strided('N', n, nrhs, a, lda, stride_a, ipiv, stride_ipiv, & - b, ldb, stride_b, batch_size, info) -#else - call dgetrs_batch_strided('N', n, nrhs, a, lda, stride_a, ipiv, stride_ipiv, & - b, ldb, stride_b, batch_size, info) -#endif - !$omp end target data - - call system_clock(end_time) ! Stop timer - - if (any(info .ne. 0)) then - print *, 'Error: getrs_batch_strided returned with errors.' - stop - else - - ! Compute a_orig*b and compare result to saved RHS - do i = 1, batch_size - do j = 1, nrhs - x = 0.0 -#if defined(SP) - call sgemv('N', n, n, 1.0, a_orig(:,i), lda, b(:,(i-1)*nrhs+j), 1, 0.0, x, 1) -#else - call dgemv('N', n, n, 1.0d0, a_orig(:,i), lda, b(:,(i-1)*nrhs+j), 1, 0.0d0, x, 1) -#endif - - ! Check relative residual - residual = norm2(b_orig(:,(i-1)*nrhs+j) - x(:)) / norm2(b_orig(:,(i-1)*nrhs+j)) - if (residual > threshold) then - print *, 'Warning: relative residual of ', residual - endif - enddo - enddo - - cycle_time = dble(end_time - start_time) / dble(clock_precision) - print *, 'Computation completed successfully', cycle_time, 'seconds' - total_time = total_time + cycle_time - endif - endif - enddo - - print *, 'Total time:', total_time, 'seconds' - - ! Clean up - deallocate (a, b, a_orig, b_orig, x, ipiv, info) -end program solve_batched_linear_systems diff --git a/Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload_optimized.F90 b/Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload_optimized.F90 deleted file mode 100644 index be1275e18f..0000000000 --- a/Libraries/oneMKL/batched_linear_solver/lu_solve_omp_offload_optimized.F90 +++ /dev/null @@ -1,189 +0,0 @@ -!=============================================================================== -! Copyright 2021-2022 Intel Corporation. -! -! This software and the related documents are Intel copyrighted materials, and -! your use of them is governed by the express license under which they were -! provided to you (License). Unless the License provides otherwise, you may not -! use, modify, copy, publish, distribute, disclose or transmit this software or -! the related documents without Intel's prior written permission. -! -! This software and the related documents are provided as is, with no express -! or implied warranties, other than those that are expressly stated in the -! License. -!=============================================================================== -! -! Content: -! Intel(R) oneAPI Math Kernel Library (oneMKL) -! FORTRAN OpenMP offload examples for solving batched linear systems. -! -! Compile for CPU: -! ifx -i8 -qmkl -free \ -! lu_solve_omp_offload_ex3_timer.F90 -o lu_solve_ex3_timer -! -! Compile for GPU: -! ifx -i8 -DMKL_ILP64 -qopenmp -fopenmp-targets=spir64 -free \ -! -qmkl -qmkl-sycl-impl=lapack \ -! lu_solve_omp_offload_ex3_timer.F90 -o lu_solve_ex3_omp_timer -! -! Compile with -DSP to use single precision instead of double precision. -! -!******************************************************************************* - -!$ include "mkl_omp_offload.f90" - -program solve_batched_linear_systems - -! Decide whether to use 32- or 64-bit integer type -#if defined(MKL_ILP64) -!$ use onemkl_lapack_omp_offload_ilp64 ! 64-bit -#else -!$ use onemkl_lapack_omp_offload_lp64 ! 32-bit -#endif - - implicit none - - integer :: n = 64, batch_size = 4096, nrhs = 1, cycles = 5 - integer :: lda, stride_a, stride_ipiv - integer :: ldb, stride_b - integer, allocatable :: ipiv(:,:), info_rf(:), info_rs(:) - -#if defined(SP) - real (kind=4), allocatable :: a(:,:), b(:,:), a_orig(:,:), b_orig(:,:), x(:) - real (kind=4) :: residual, threshold = 1.0e-5 -#else - real (kind=8), allocatable :: a(:,:), b(:,:), a_orig(:,:), b_orig(:,:), x(:) - real (kind=8) :: residual, threshold = 1.0d-9 -#endif - - integer (kind=8) :: start_time, end_time, clock_precision - real (kind=8) :: cycle_time, total_time = 0.0d0 - - integer :: i, j, c, allocstat, stat - character (len = 132) :: allocmsg - character (len = 32) :: arg1, arg2 - - ! Simple command-line parser with no error checks - do i = 1, command_argument_count(), 2 - call get_command_argument(i, arg1) - select case (arg1) - case ('-n') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) n - case ('-b') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) batch_size - case ('-r') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) nrhs - case ('-c') - call get_command_argument(i+1, arg2) - read(arg2, *, iostat=stat) cycles - case default - print *, 'Unrecognized command-line option:', arg1 - stop - end select - enddo - print *, 'Matrix dimensions:', n - print *, 'Batch size:', batch_size - print *, 'Number of RHS:', nrhs - print *, 'Number of test cycles:', cycles - - lda = n - stride_a = n * lda - stride_ipiv = n - ldb = n - stride_b = n * nrhs - - ! Allocate memory for linear algebra computations - allocate (a(stride_a, batch_size), b(n, batch_size*nrhs), & - ipiv(stride_ipiv, batch_size), & - info_rf(batch_size), info_rs(batch_size), & - stat = allocstat, errmsg = allocmsg) - if (allocstat > 0) stop trim(allocmsg) - - ! Allocate memory for error checking - allocate (a_orig(stride_a, batch_size), b_orig(n, batch_size*nrhs), x(n), & - stat = allocstat, errmsg = allocmsg) - if (allocstat > 0) stop trim(allocmsg) - - call system_clock(count_rate = clock_precision) - call random_seed() - - do c = 1, cycles - ! Initialize the matrices with a random number in the interval (-0.5, 0.5) - call random_number(a) - a = 0.5 - a - ! Make diagonal band values larger to ensure well-conditioned matrices - do i = 1, n - a(i+(i-1)*lda,:) = a(i+(i-1)*lda,:) + 50.0 - if (i .ne. 1) a(i+(i-1)*lda-1,:) = a(i+(i-1)*lda-1,:) + 20.0 - if (i .ne. n) a(i+(i-1)*lda+1,:) = a(i+(i-1)*lda+1,:) + 20.0 - enddo - ! Initialize the RHS with a random number in the interval (-2.5, 2.5) - call random_number(b) - b = 2.5 - (5.0 * b) - a_orig = a - b_orig = b - - call system_clock(start_time) ! Start timer - - ! Compute the LU factorizations and solve the linear systems using OpenMP offload. - ! On entry, "a" contains the input matrices. On exit, it contains the factored matrices. - !$omp target data map(to:a) map(tofrom: b) map(from:info_rf, info_rs) & - !$ map(alloc:ipiv(1:stride_ipiv, 1:batch_size)) - !$omp dispatch -#if defined(SP) - call sgetrf_batch_strided(n, n, a, lda, stride_a, ipiv, stride_ipiv, batch_size, info_rf) -#else - call dgetrf_batch_strided(n, n, a, lda, stride_a, ipiv, stride_ipiv, batch_size, info_rf) -#endif - - !$omp dispatch -#if defined(SP) - call sgetrs_batch_strided('N', n, nrhs, a, lda, stride_a, ipiv, stride_ipiv, & - b, ldb, stride_b, batch_size, info_rs) -#else - call dgetrs_batch_strided('N', n, nrhs, a, lda, stride_a, ipiv, stride_ipiv, & - b, ldb, stride_b, batch_size, info_rs) -#endif - !$omp end target data - - call system_clock(end_time) ! Stop timer - - if (any(info_rf .ne. 0)) then - print *, 'Error: getrf_batch_strided returned with errors.' - stop - elseif (any(info_rs .ne. 0)) then - print *, 'Error: getrs_batch_strided returned with errors.' - stop - else - - ! Compute a_orig*b and compare result to saved RHS - do i = 1, batch_size - do j = 1, nrhs - x = 0.0 -#if defined(SP) - call sgemv('N', n, n, 1.0, a_orig(:,i), lda, b(:,(i-1)*nrhs+j), 1, 0.0, x, 1) -#else - call dgemv('N', n, n, 1.0d0, a_orig(:,i), lda, b(:,(i-1)*nrhs+j), 1, 0.0d0, x, 1) -#endif - - ! Check relative residual - residual = norm2(b_orig(:,(i-1)*nrhs+j) - x(:)) / norm2(b_orig(:,(i-1)*nrhs+j)) - if (residual > threshold) then - print *, 'Warning: relative residual of ', residual - endif - enddo - enddo - - cycle_time = dble(end_time - start_time) / dble(clock_precision) - print *, 'Computation completed successfully', cycle_time, 'seconds' - total_time = total_time + cycle_time - endif - enddo - - print *, 'Total time:', total_time, 'seconds' - - ! Clean up - deallocate (a, b, a_orig, b_orig, x, ipiv, info_rf, info_rs) -end program solve_batched_linear_systems diff --git a/Libraries/oneMKL/batched_linear_solver/makefile b/Libraries/oneMKL/batched_linear_solver/makefile deleted file mode 100644 index 135ccde9a5..0000000000 --- a/Libraries/oneMKL/batched_linear_solver/makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Makefile for Linux - -default: run_all - -all: run_all - -run_all: lu_solve lu_solve_omp_offload lu_solve_omp_offload_optimized - ./lu_solve -n 64 -b 8 -r 1 -c 2 - ./lu_solve_omp_offload -n 64 -b 8 -r 1 -c 2 - ./lu_solve_omp_offload_optimized -n 64 -b 8 -r 1 -c 2 - -IFX_OPTS = -i8 -free -qmkl -IFX_OPTS_OFFLOAD = -DMKL_ILP64 -qopenmp -fopenmp-targets=spir64 -qmkl-sycl-impl=lapack - -lu_solve: lu_solve_omp_offload.F90 - ifx $< -o $@ $(IFX_OPTS) - -lu_solve_omp_offload: lu_solve_omp_offload.F90 - ifx $< -o $@ $(IFX_OPTS) $(IFX_OPTS_OFFLOAD) - -lu_solve_omp_offload_optimized: lu_solve_omp_offload_optimized.F90 - ifx $< -o $@ $(IFX_OPTS) $(IFX_OPTS_OFFLOAD) - -clean: - -rm -f lu_solve lu_solve_omp_offload lu_solve_omp_offload_optimized *.mod *.modmic - -.PHONY: run_all clean all diff --git a/Libraries/oneMKL/batched_linear_solver/sample.json b/Libraries/oneMKL/batched_linear_solver/sample.json deleted file mode 100644 index f456014ea6..0000000000 --- a/Libraries/oneMKL/batched_linear_solver/sample.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "guid": "B90C0393-6FCE-443B-8CFA-2576FC8FDA2C", - "name": "Batched Linear Solver", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Solve batched linear systems using oneMKL and OpenMP target offloading", - "toolchain": [ "ifx" ], - "dependencies": [ "oneMKL" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "gpuRequired": ["gen9","pvc"], - "os": [ "linux" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "batched_linear_solver", - "steps": [ - "make clean", - "make" - ] - } - ] - }, - "expertise": "Code Optimization" -} diff --git a/Libraries/oneMKL/batched_linear_solver/third-party-programs.txt b/Libraries/oneMKL/batched_linear_solver/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/batched_linear_solver/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/binomial/GNUmakefile b/Libraries/oneMKL/binomial/GNUmakefile deleted file mode 100644 index 820786a0db..0000000000 --- a/Libraries/oneMKL/binomial/GNUmakefile +++ /dev/null @@ -1,13 +0,0 @@ -all: binomial_sycl - -init_on_host ?= 0 - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl=rng - -binomial_sycl: src/binomial_sycl.cpp src/binomial_main.cpp src/binomial.hpp - icpx -fsycl -O3 -DSMALL_OPT_N=0 -DVERBOSE=1 -DREPORT_COLD=1 -DREPORT_WARM=1 -DINIT_ON_HOST=$(init_on_host) $(MKL_COPTS) -o $@ src/binomial_main.cpp src/binomial_sycl.cpp - -clean: - @rm -f binomial_sycl - -.PHONY: clean all diff --git a/Libraries/oneMKL/binomial/README.md b/Libraries/oneMKL/binomial/README.md deleted file mode 100644 index eec3848424..0000000000 --- a/Libraries/oneMKL/binomial/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# `Binomial` Sample - -Binomial shows how to use Random Number Generator (RNG) functionality -available in Intel® oneAPI Math Kernel Library (oneMKL). It uses for -european options pricing using binomial options pricing model -for suitable randomly-generated portfolios. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows 10 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use the oneMKL random number generation functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, -see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -The binomial options pricing model is widely used in financial markets. -It has a lot of computation after random numbers are generated. - -The sample first generates a portfolio within given constraints using a uniform -distribution and a Philox-type generator provided by the oneMKL RNG API. - -This sample performs its computations on the default SYCL* device. You can set -the `ONEAPI_DEVICE_SELECTOR` environment variable to `"*:cpu"` or `"*:gpu"` -to select the device to use. -To find more information about the variable follow the link: -[ONEAPI_DEVICE_SELECTOR](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector). - -## Key Implementation Details - -This sample illustrates how to create an RNG engine object (the source of -pseudo-randomness), a distribution object (specifying the desired probability -distribution), and finally generate the random numbers themselves. - -In this sample, a Philox 4x32x10 generator is used. It is a lightweight -counter-based RNG well-suited for parallel computing. - -This sample has pretty heavy kernel. It means that the kernel -contains a lot of computations. - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Binomial Sample - -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build the sample. Then run the sample calling generated execution file. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample programs. `nmake clean` removes temporary files. - -#### Build a sample using Random Number Generation on Host -To use the RNG on host use `init_on_host=1`, e.g. -``` -make init_on_host=1 -``` -for Linux* system or - -``` -nmake init_on_host=1 -``` - -for Windows* System. - -## Running the Binomial Sample -If everything is working correctly, the program will run the Binomial simulation. -After the simulation, results will be checked against the known true values -given by the Black-Scholes formula, and the absolute error is output. - -Example of output: -``` -$ ./binomial_sycl - -Double Precision Binomial Option Pricing version 1.8 running on Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz using DPC++, workgroup size 128, sub-group size 32. -Compiler Version: Intel(R) oneAPI DPC++/C++ Compiler 2023.1.0 (2023.1.0.20230320), LLVM 16.0 based. -Driver Version : 2023.15.3.0.20_160000 -Build Time : May 3 2023 03:51:58 -Input Dataset : 8388608 -Pricing 8388608 Options with time step of 2048. -Cold iteration. -Completed in 379.85246 seconds. Options per second: 22083.85865 -Warm iteration. -Completed in 378.85559 seconds. Options per second: 22141.96683 -Time Elapsed = 378.85559 seconds -Creating the reference result... -L1 norm: 2.645901E-06 -TEST PASSED -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/binomial/makefile b/Libraries/oneMKL/binomial/makefile deleted file mode 100644 index 007459efc5..0000000000 --- a/Libraries/oneMKL/binomial/makefile +++ /dev/null @@ -1,15 +0,0 @@ -all: binomial_sycl.exe - -!if "$(init_on_host)" == "1" - INIT_ON_HOST=/DINIT_ON_HOST=1 -!endif - -DPCPP_OPTS=-O3 /I"$(MKLROOT)\include" /DMKL_ILP64 /DVERBOSE=1 /DSMALL_OPT_N=0 /DREPORT_COLD=1 /DREPORT_WARM=1 $(INIT_ON_HOST) -fsycl /Qmkl /Qmkl-sycl-impl=rng OpenCL.lib - -binomial_sycl.exe: src\binomial_sycl.cpp src\binomial_main.cpp src\binomial.hpp - icx $(DPCPP_OPTS) /DVERBOSE=1 /DSMALL_OPT_N=0 /DREPORT_COLD=1 /DREPORT_WARM=1 src\binomial_sycl.cpp src\binomial_main.cpp /obinomial_sycl.exe - -clean: - del /q binomial_sycl.exe - -.PHONY: clean all diff --git a/Libraries/oneMKL/binomial/sample.json b/Libraries/oneMKL/binomial/sample.json deleted file mode 100644 index 97e1ea17ef..0000000000 --- a/Libraries/oneMKL/binomial/sample.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "guid": "0DDCAFEA-65A6-4DE1-ACFF-FB219612E91F", - "name": "Binomial", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Binomial European Option Pricing Model Simulation using Intel® oneMKL Random Number Generators", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "gpuRequired": ["gen9","pvc"], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "binomial", - "steps": [ - "make clean", - "make && ./binomial_sycl" - ] - } - ], - "windows": [ - { - "id": "binomial", - "steps": [ - "nmake clean", - "nmake && binomial_sycl.exe" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/binomial/src/binomial.hpp b/Libraries/oneMKL/binomial/src/binomial.hpp deleted file mode 100644 index 073ea1be42..0000000000 --- a/Libraries/oneMKL/binomial/src/binomial.hpp +++ /dev/null @@ -1,75 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#ifndef __Binomial_HPP__ -#define __Binomial_HPP__ - -#include - -#ifndef VERBOSE -#define VERBOSE 0 -#endif - -/******* VERSION *******/ - -#define MAJOR 1 -#define MINOR 8 - -/******* VERSION *******/ - -constexpr float volatility = 0.10f; -constexpr float risk_free = 0.06f; - -constexpr int num_steps = 2048; -constexpr int opt_n = -#if SMALL_OPT_N - 480; -#else - 8 * 1024 * 1024; -#endif - -#ifndef __clang_major__ -#define __clang_major__ 0 -#endif -#ifndef __clang_minor__ -#define __clang_minor__ 0 -#endif -#ifndef __VERSION__ -#define __VERSION__ __clang_major__ -#endif - -template -class Binomial { - public: - Binomial(); - ~Binomial(); - - void run(); - void check(); - - private: - DATA_TYPE* h_call_result; - DATA_TYPE* h_stock_price; - DATA_TYPE* h_option_strike; - DATA_TYPE* h_option_years; - - void body(); -}; - -class timer { - public: - timer() { start(); } - void start() { t1_ = std::chrono::steady_clock::now(); } - void stop() { t2_ = std::chrono::steady_clock::now(); } - auto duration() { return std::chrono::duration(t2_ - t1_).count(); } - - private: - std::chrono::steady_clock::time_point t1_, t2_; -}; - -bool is_fp64(); - -#endif // __Binomial_HPP__ diff --git a/Libraries/oneMKL/binomial/src/binomial_main.cpp b/Libraries/oneMKL/binomial/src/binomial_main.cpp deleted file mode 100644 index a574584f57..0000000000 --- a/Libraries/oneMKL/binomial/src/binomial_main.cpp +++ /dev/null @@ -1,87 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#include -#include -#include -#include - -#include "binomial.hpp" - -// Black-Scholes Reference Implementation -void BlackScholesRefImpl(double& callResult, - double Sf, // Stock price - double Xf, // Option strike - double Tf, // Option years - double Rf, // Riskless rate - double Vf // Volatility rate -) { - // BSM Formula: - // https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/ - double S = Sf, L = Xf, t = Tf, r = Rf, sigma = Vf; - double N_d1 = - 1. / 2. + 1. / 2. * - std::erf(((log(S / L) + (r + 0.5 * sigma * sigma) * t) / - (sigma * std::sqrt(t))) / - std::sqrt(2.)); - double N_d2 = - 1. / 2. + 1. / 2. * - std::erf(((log(S / L) + (r - 0.5 * sigma * sigma) * t) / - (sigma * std::sqrt(t))) / - std::sqrt(2.)); - callResult = (S * N_d1 - L * std::exp(-r * t) * N_d2); -} - -template -void Binomial::check() { - if (VERBOSE) { - std::printf("Creating the reference result...\n"); - std::vector h_call_result_host(opt_n); - - for (int opt = 0; opt < opt_n; opt++) - BlackScholesRefImpl(h_call_result_host[opt], h_stock_price[opt], - h_option_strike[opt], h_option_years[opt], risk_free, - volatility); - - double sum_delta = 0.0, sum_ref = 0.0, max_delta = 0.0, errorVal = 0.0; - - for (int i = 0; i < opt_n; i++) { - double ref = h_call_result_host[i]; - auto delta = std::fabs(ref - h_call_result[i]); - if (delta > max_delta) { - max_delta = delta; - } - sum_delta += delta; - sum_ref += std::fabs(ref); - } - if (sum_ref > 1E-5) - std::printf("L1 norm: %E\n", errorVal = sum_delta / sum_ref); - else - std::printf("Avg. diff: %E\n", errorVal = sum_delta / opt_n); - if(errorVal < 5e-4){ - std::printf("TEST PASSED\n"); - } - else{ - std::printf("TEST FAILED\n"); - exit(1); - } - } -} - -int main(int argc, char** argv) { - if(is_fp64()){ - Binomial test; - test.run(); - test.check(); - } - else{ - std::cout<<"Warning: could not find a device with double precision support. Single precision is used."< test; - test.run(); - test.check(); - } - return 0; -} diff --git a/Libraries/oneMKL/binomial/src/binomial_sycl.cpp b/Libraries/oneMKL/binomial/src/binomial_sycl.cpp deleted file mode 100644 index 00bdbc351e..0000000000 --- a/Libraries/oneMKL/binomial/src/binomial_sycl.cpp +++ /dev/null @@ -1,202 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= -#include -#include -#include - -#include "binomial.hpp" - -constexpr int sg_size = 32; -constexpr int wg_size = 128; - -sycl::queue* binomial_queue; - -template -class k_binomial; // can be useful for profiling - -template -Binomial::Binomial() { - binomial_queue = new sycl::queue; - - h_call_result = sycl::malloc_shared(opt_n, *binomial_queue); - h_stock_price = sycl::malloc_shared(opt_n, *binomial_queue); - h_option_strike = sycl::malloc_shared(opt_n, *binomial_queue); - h_option_years = sycl::malloc_shared(opt_n, *binomial_queue); - - binomial_queue->fill(h_call_result, DATA_TYPE(0), opt_n); - - constexpr int rand_seed = 777; - namespace mkl_rng = oneapi::mkl::rng; - - // create random number generator object - mkl_rng::philox4x32x10 engine( -#if !INIT_ON_HOST - *binomial_queue, -#else - sycl::queue{sycl::cpu_selector_v}, -#endif - rand_seed); - - sycl::event event_1 = mkl_rng::generate( - mkl_rng::uniform(5.0, 50.0), engine, opt_n, h_stock_price); - sycl::event event_2 = mkl_rng::generate( - mkl_rng::uniform(10.0, 25.0), engine, opt_n, h_option_strike); - sycl::event event_3 = mkl_rng::generate( - mkl_rng::uniform(1.0, 5.0), engine, opt_n, h_option_years); - sycl::event::wait({event_1, event_2, event_3}); -} - -template -Binomial::~Binomial() { - sycl::free(h_call_result, *binomial_queue); - sycl::free(h_stock_price, *binomial_queue); - sycl::free(h_option_strike, *binomial_queue); - sycl::free(h_option_years, *binomial_queue); - - delete binomial_queue; -} - -template -void Binomial::body() { - constexpr int block_size = num_steps / wg_size; - static_assert(block_size * wg_size == num_steps); - - // "this" can not be captured to the kernel. So, we need to copy internals of - // the class to local variables - DATA_TYPE* h_stock_price_local = this->h_stock_price; - DATA_TYPE* h_option_years_local = this->h_option_years; - DATA_TYPE* h_option_strike_local = this->h_option_strike; - DATA_TYPE* h_call_result_local = this->h_call_result; - - binomial_queue->submit([&](sycl::handler& h) { - sycl::local_accessor slm_call{wg_size + 1, h}; - - h.parallel_for>( - sycl::nd_range(sycl::range<1>(opt_n * wg_size), - sycl::range<1>(wg_size)), - [=](sycl::nd_item<1> item) - [[intel::kernel_args_restrict]] [[sycl::reqd_sub_group_size( - sg_size)]] { - const size_t opt = item.get_global_id(0) / wg_size; - const DATA_TYPE sx = h_stock_price_local[opt]; - const DATA_TYPE xx = h_option_strike_local[opt]; - const DATA_TYPE tx = h_option_years_local[opt]; - const DATA_TYPE dt = tx / static_cast(num_steps); - const DATA_TYPE v_dt = volatility * sycl::sqrt(dt); - const DATA_TYPE r_dt = risk_free * dt; - const DATA_TYPE i_f = sycl::exp(r_dt); - const DATA_TYPE df = sycl::exp(-r_dt); - const DATA_TYPE u = sycl::exp(v_dt); - const DATA_TYPE d = sycl::exp(-v_dt); - const DATA_TYPE pu = (i_f - d) / (u - d); - const DATA_TYPE pd = static_cast(1.0) - pu; - const DATA_TYPE pu_df = pu * df; - const DATA_TYPE pd_df = pd * df; - const DATA_TYPE mul_c = v_dt * static_cast(2.0); - DATA_TYPE id = v_dt * static_cast(-num_steps); - - DATA_TYPE local_call[block_size + 1]; - auto wg = item.get_group(); - int local_id = wg.get_local_id(0); - int block_start = block_size * local_id; - id += block_start * mul_c; - for (int i = 0; i < block_size; i++) { - auto d = sx * sycl::exp(id) - xx; - local_call[i] = (d > 0) ? d : 0; - id += mul_c; - } - - // Handling num_steps step by last item and putting it directly to - // SLM last element - if (local_id == wg_size - 1) { - auto d = sx * sycl::exp(id) - xx; - slm_call[wg_size] = (d > 0) ? d : 0; - } - - // Start at the final tree time step nodes(leaves) and walk - // backwards to calculate the call option price. - for (int i = num_steps; i > 0; i--) { - // Give and get "next block's local_call[j+1]" (local_call[0] in - // next block) elements across work items - slm_call[local_id] = local_call[0]; - if (wg_size > sg_size) { - item.barrier(sycl::access::fence_space::local_space); - } - local_call[block_size] = slm_call[local_id + 1]; - if (wg_size > sg_size) { - item.barrier(sycl::access::fence_space::local_space); - } - if (block_start <= i) { - for (int j = 0; j < block_size; j++) { - local_call[j] = - pu_df * local_call[j + 1] + pd_df * local_call[j]; - } - } - } - if (local_id == 0) { - h_call_result_local[opt] = local_call[0]; - } - }); - }); - - binomial_queue->wait(); -} - -template -void Binomial::run() { - std::printf( - "%s Precision Binomial Option Pricing version %d.%d running on %s using " - "DPC++, workgroup size %d, sub-group size %d.\n", - sizeof(DATA_TYPE) > 4 ? "Double" : "Single", MAJOR, MINOR, - binomial_queue->get_device().get_info().c_str(), - wg_size, sg_size); - - std::printf("Compiler Version: %s, LLVM %d.%d based.\n", __VERSION__, - __clang_major__, __clang_minor__); - std::printf("Driver Version : %s\n", - binomial_queue->get_device() - .get_info() - .c_str()); - std::printf("Build Time : %s %s\n", __DATE__, __TIME__); - std::printf("Input Dataset : %d\n", opt_n); - std::printf("Pricing %d Options with time step of %d.\n", opt_n, num_steps); - fflush(stdout); - std::printf("Cold iteration.\n"); - fflush(stdout); - timer t{}; - t.start(); - body(); - t.stop(); -#if REPORT_COLD - std::printf("Completed in %10.5f seconds. Options per second: %10.5f\n", - t.duration(), static_cast(opt_n) / (t.duration())); -#endif -#if REPORT_WARM - std::printf("Warm iteration.\n"); - fflush(stdout); - t.start(); - body(); - t.stop(); - std::printf("Completed in %10.5f seconds. Options per second: %10.5f\n", - t.duration(), static_cast(opt_n) / (t.duration())); -#endif - std::printf("Time Elapsed = %10.5f seconds\n", t.duration()); - fflush(stdout); -} - -bool is_fp64() { - sycl::queue test_queue; - return test_queue.get_device().has(sycl::aspect::fp64); -} - -template DLL_EXPORT Binomial::Binomial(); -template DLL_EXPORT Binomial::Binomial(); - -template DLL_EXPORT Binomial::~Binomial(); -template DLL_EXPORT Binomial::~Binomial(); - -template DLL_EXPORT void Binomial::run(); -template DLL_EXPORT void Binomial::run(); diff --git a/Libraries/oneMKL/binomial/third-party-programs.txt b/Libraries/oneMKL/binomial/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/binomial/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/black_scholes/GNUmakefile b/Libraries/oneMKL/black_scholes/GNUmakefile deleted file mode 100644 index 3d51c6e90f..0000000000 --- a/Libraries/oneMKL/black_scholes/GNUmakefile +++ /dev/null @@ -1,18 +0,0 @@ -# ============================================================================== -# Content: -# Black-Scholes formula example makefile -# ============================================================================== - -all: black_scholes_sycl - -init_on_host ?= 0 - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl=rng - -black_scholes_sycl: src/black_scholes_sycl.cpp - icpx -O3 -g -fsycl $(MKL_COPTS) -DVERBOSE=1 -DSMALL_OPT_N=0 -DINIT_ON_HOST=$(init_on_host) -o $@ src/black_scholes_sycl.cpp - -clean: - @rm -f black_scholes_sycl - -.PHONY: clean all diff --git a/Libraries/oneMKL/black_scholes/License.txt b/Libraries/oneMKL/black_scholes/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/black_scholes/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/black_scholes/README.md b/Libraries/oneMKL/black_scholes/README.md deleted file mode 100644 index 220fb12a58..0000000000 --- a/Libraries/oneMKL/black_scholes/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# `Black-Scholes` Sample - -Black-Scholes shows how to use Random Number Generator (RNG) functionality -available in Intel® oneAPI Math Kernel Library (oneMKL) to calculate the prices -of options using the Black-Scholes formula for suitable randomly-generated portfolios. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows 10, 11 -| Hardware | Skylake CPU with Gen9 GPU or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use the oneMKL random number generation functionality -| Time to complete | 5 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, -see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -The Black-Scholes formula is widely used in financial markets as a basic -prognostic tool. The ability to calculate it quickly for a large number of -options has become a necessity and represents a classic problem in parallel -computation. - -The sample first generates a portfolio within given constraints using a uniform -distribution and a Philox-type generator provided by the oneMKL RNG API. - -This sample performs its computations on the default SYCL* device. You can set -the `ONEAPI_DEVICE_SELECTOR` environment variable to `"*:cpu"` or `"*:gpu"` -to select the device to use. -To find more information about the variable follow the link: -[ONEAPI_DEVICE_SELECTOR](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector). - -This article explains in detail how oneMKL functions speed up Black-Scholes -computation of European options pricing: -https://www.intel.com/content/www/us/en/docs/onemkl/cookbook/current/black-scholes-formula-european-options-pricing.html. - -## Key Implementation Details - -This sample illustrates how to create an RNG engine object (the source of -pseudo-randomness), a distribution object (specifying the desired probability -distribution), and finally generate the random numbers themselves. - -In this sample, a Philox 4x32x10 generator is used. It is a lightweight -counter-based RNG well-suited for parallel computing. - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Black-Scholes Sample - -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build the sample. Then run the sample calling generated execution file. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample programs. `nmake clean` removes temporary files. - -#### Build a sample using Random Number Generation on Host -To use the RNG on host use `init_on_host=1`, e.g. -``` -make init_on_host=1 -``` -for Linux* system or - -``` -nmake init_on_host=1 -``` - -for Windows* System. - -## Running the Black-Scholes Sample -If everything is working correctly, the program will run the Black-scholes simulation. -After the simulation, results will be checked against the known true values -given by the Black-Scholes formula, and the absolute error is output. - -Example of output: -``` -$ ./black_scholes_sycl - -Double Precision Black&Scholes Option Pricing version 1.6 running on Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz using DPC++, workgroup size 256, sub-group size 32. -Compiler Version: Intel(R) oneAPI DPC++/C++ Compiler 2023.1.0 (2023.1.0.20230320), LLVM 16.0 based. -Driver Version : 2023.15.3.0.20_160000 -Build Time : Apr 28 2023 05:34:33 -Input Dataset : 8388608 -Pricing 16777216 Options in 512 iterations, 8589934592 Options in total. -Completed in 1.41111 seconds. GOptions per second: 6.08735 -Time Elapsed = 1.41111 seconds -Creating the reference result... -L1 norm: 1.385136E-16 -TEST PASSED - -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/black_scholes/makefile b/Libraries/oneMKL/black_scholes/makefile deleted file mode 100644 index 271caca621..0000000000 --- a/Libraries/oneMKL/black_scholes/makefile +++ /dev/null @@ -1,15 +0,0 @@ -all: black_scholes_sycl.exe - -!if "$(init_on_host)" == "1" - INIT_ON_HOST=/DINIT_ON_HOST=1 -!endif - -DPCPP_OPTS=-O3 /I"$(MKLROOT)\include" /DMKL_ILP64 /DVERBOSE=1 /DSMALL_OPT_N=0 $(INIT_ON_HOST) -fsycl /Qmkl /Qmkl-sycl-impl=rng OpenCL.lib - -black_scholes_sycl.exe: src\black_scholes_sycl.cpp - icx $(DPCPP_OPTS) src\black_scholes_sycl.cpp /oblack_scholes_sycl.exe - -clean: - del /q black_scholes_sycl.exe - -.PHONY: clean all diff --git a/Libraries/oneMKL/black_scholes/sample.json b/Libraries/oneMKL/black_scholes/sample.json deleted file mode 100644 index 972daee9f6..0000000000 --- a/Libraries/oneMKL/black_scholes/sample.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "guid": "7095DF22-8CBC-44FE-8E13-DDEFC49A7B18", - "name": "Black Scholes", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Black Scholes formula calculation using Intel® oneMKL Vector Math and Random Number Generators", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "gpuRequired": ["gen9","pvc"], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "black_scholes", - "steps": [ - "make clean", - "make && ./black_scholes_sycl" - ] - } - ], - "windows": [ - { - "id": "black_scholes", - "steps": [ - "nmake clean", - "nmake && black_scholes_sycl.exe" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/black_scholes/src/black_scholes.hpp b/Libraries/oneMKL/black_scholes/src/black_scholes.hpp deleted file mode 100644 index 82f2f13a0a..0000000000 --- a/Libraries/oneMKL/black_scholes/src/black_scholes.hpp +++ /dev/null @@ -1,132 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#ifndef __BLACK_SCHOLES_HPP__ -#define __BLACK_SCHOLES_HPP__ - -#include -#include - -/******* VERSION *******/ -#define MAJOR 1 -#define MINOR 6 -/******* VERSION *******/ - -// #ifndef DATA_TYPE -// #define DATA_TYPE double -// #endif - -#ifndef VERBOSE -#define VERBOSE 1 -#endif - -constexpr float volatility = 0.30f; -constexpr float risk_free = 0.02f; - -constexpr size_t opt_n = -#if SMALL_OPT_N - 480; -#else - 8 * 1024 * 1024; -#endif - -#ifndef ITER_N -#define ITER_N 512 -#endif - -#ifndef __clang_major__ -#define __clang_major__ 0 -#endif -#ifndef __clang_minor__ -#define __clang_minor__ 0 -#endif -#ifndef __VERSION__ -#define __VERSION__ __clang_major__ -#endif - -template -class BlackScholes { -public: - BlackScholes(); - ~BlackScholes(); - void run(); - void check(); - -private: - DATA_TYPE* h_call_result; - DATA_TYPE* h_put_result; - DATA_TYPE* h_stock_price; - DATA_TYPE* h_option_strike; - DATA_TYPE* h_option_years; - void body(); -}; - -// Black-Scholes Reference Implementation -void BlackScholesRefImpl( - double& call_result, - double Sf, //Stock price - double Xf, //Option strike - double Tf, //Option years - double Rf, //Riskless rate - double Vf //Volatility rate -) -{ - // BSM Formula: https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/ - double S = Sf, L = Xf, t = Tf, r = Rf, sigma = Vf; - double N_d1 = 1. / 2. + 1. / 2. * std::erf(((std::log(S / L) + (r + 0.5 * sigma * sigma) * t) / (sigma * std::sqrt(t))) / std::sqrt(2.)); - double N_d2 = 1. / 2. + 1. / 2. * std::erf(((std::log(S / L) + (r - 0.5 * sigma * sigma) * t) / (sigma * std::sqrt(t))) / std::sqrt(2.)); - call_result = (S * N_d1 - L * std::exp(-r * t) * N_d2); -} - -template -void BlackScholes::check() -{ - if (VERBOSE) { - std::printf("Creating the reference result...\n"); - std::vector h_CallResultCPU(opt_n); - - for (size_t opt = 0; opt < opt_n; opt++) - BlackScholesRefImpl(h_CallResultCPU[opt], h_stock_price[opt], h_option_strike[opt], h_option_years[opt], risk_free, volatility); - - double sum_delta = 0.0, - sum_ref = 0.0, - max_delta = 0.0, - errorVal = 0.0; - - for (size_t i = 0; i < opt_n; i++) { - auto ref = h_CallResultCPU[i]; - auto delta = std::fabs(h_CallResultCPU[i] - h_call_result[i]); - if (delta > max_delta) { - max_delta = delta; - } - sum_delta += delta; - sum_ref += std::fabs(ref); - } - if (sum_ref > 1E-5) - std::printf("L1 norm: %E\n", errorVal = sum_delta / sum_ref); - else - std::printf("Avg. diff: %E\n", errorVal = sum_delta / opt_n); - if(errorVal < 5e-4){ - std::printf("TEST PASSED\n"); - } - else{ - std::printf("TEST FAILED\n"); - exit(1); - } - } -} - -class timer { -public: - timer() { start(); } - void start() { t1_ = std::chrono::steady_clock::now(); } - void stop() { t2_ = std::chrono::steady_clock::now(); } - auto duration() { return std::chrono::duration(t2_ - t1_).count(); } -private: - std::chrono::steady_clock::time_point t1_, t2_; -}; - -#endif // __BLACK_SCHOLES_HPP__ diff --git a/Libraries/oneMKL/black_scholes/src/black_scholes_sycl.cpp b/Libraries/oneMKL/black_scholes/src/black_scholes_sycl.cpp deleted file mode 100644 index 7423008b6e..0000000000 --- a/Libraries/oneMKL/black_scholes/src/black_scholes_sycl.cpp +++ /dev/null @@ -1,192 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#include - -#if !SYCL_LANGUAGE_VERSION -#error "SYCL is not enabled"" -#endif - -#include -#include - -#include "black_scholes.hpp" - -constexpr int sg_size = 32; -#if NON_DEFAULT_SIZE -constexpr int wg_size = 128; -constexpr int block_size = 1; -#else -constexpr int wg_size = 256; -constexpr int block_size = 4; -#endif - -sycl::queue* black_scholes_queue; - -template -class k_BlackScholes; - -#if USE_CNDF_C - -template -__attribute__((always_inline)) -static inline T CNDF_C(T input) -{ - constexpr T inv_sqrt_2xPI = 0.39894228040143270286; - constexpr T CNDF_C1 = 0.2316419; - constexpr T CNDF_C2 = 0.319381530; - constexpr T CNDF_C3 = -0.356563782; - constexpr T CNDF_C4 = 1.781477937; - constexpr T CNDF_C5 = -1.821255978; - constexpr T CNDF_C6 = 1.330274429; - constexpr T CNDF_LN2 = 0.693147180559945309417; - constexpr T INV_LN2X2 = 1.0 / (CNDF_LN2 * 2.0); - - T x = (input < 0.0) ? -input : input; - - T k2 = 1.0 / (1.0 + CNDF_C1 * x); - T k2_2 = k2 * k2; - T k2_3 = k2_2 * k2; - T k2_4 = k2_3 * k2; - T k2_5 = k2_4 * k2; - - T output = 1.0 - (inv_sqrt_2xPI * sycl::exp2(-x * x * INV_LN2X2) * ((CNDF_C2 * k2) + - ((CNDF_C3 * (k2_2)) + (CNDF_C4 * (k2_3)) + (CNDF_C5 * (k2_4)) + (CNDF_C6 * (k2_5))))); - if (input < 0.0) - output = (1.0 - output); - - return output; -} -#endif // USE_CNDF_C - -template -void BlackScholes::body() { - // this can not be captured to the kernel. So, we need to copy internals of the class to local variables - DATA_TYPE* h_stock_price_local = this->h_stock_price; - DATA_TYPE* h_option_years_local = this->h_option_years; - DATA_TYPE* h_option_strike_local = this->h_option_strike; - DATA_TYPE* h_call_result_local = this->h_call_result; - DATA_TYPE* h_put_result_local = this->h_put_result; - - black_scholes_queue->parallel_for>(sycl::nd_range(sycl::range<1>(opt_n / block_size), sycl::range<1>(wg_size)), - [=](sycl::nd_item<1> item) [[intel::kernel_args_restrict]] [[sycl::reqd_sub_group_size(sg_size)]] { - auto local_id = item.get_local_linear_id(); - auto group_id = item.get_group_linear_id(); -#pragma unroll - for (size_t opt = group_id * block_size * wg_size + local_id, i = 0; i < block_size; opt += wg_size, i++) { - constexpr DATA_TYPE sigma = volatility; - const DATA_TYPE s = h_stock_price_local[opt]; - const DATA_TYPE t = h_option_years_local[opt]; - const DATA_TYPE x = h_option_strike_local[opt]; - const DATA_TYPE XexpRT = x * sycl::exp(-risk_free * t); -#if USE_CNDF_C - const DATA_TYPE v_sqrt = sigma * sycl::sqrt(t); - const DATA_TYPE d1 = (sycl::log(s / x) + (risk_free + DATA_TYPE(0.5) * sigma * sigma) * t) / v_sqrt; - const DATA_TYPE d2 = d1 - v_sqrt; - const DATA_TYPE n_d1 = CNDF_C(d1); - const DATA_TYPE n_d2 = CNDF_C(d2); -#else - constexpr DATA_TYPE sqrt1_2 = 0.707106781186547524401; - DATA_TYPE n_d1 = DATA_TYPE(1. / 2.) + DATA_TYPE(1. / 2.) * sycl::erf(((sycl::log(s / x) + (risk_free + DATA_TYPE(0.5) * sigma * sigma) * t) / (sigma * sycl::sqrt(t))) * sqrt1_2); - DATA_TYPE n_d2 = DATA_TYPE(1. / 2.) + DATA_TYPE(1. / 2.) * sycl::erf(((sycl::log(s / x) + (risk_free - DATA_TYPE(0.5) * sigma * sigma) * t) / (sigma * sycl::sqrt(t))) * sqrt1_2); -#endif // USE_CNDF_C - const DATA_TYPE call_val = s * n_d1 - XexpRT * n_d2; - const DATA_TYPE put_val = call_val + XexpRT - s; - h_call_result_local[opt] = call_val; - h_put_result_local[opt] = put_val; - } - }); -} - -template -BlackScholes::BlackScholes() -{ - black_scholes_queue = new sycl::queue; - - h_call_result = sycl::malloc_shared(opt_n, *black_scholes_queue); - h_put_result = sycl::malloc_shared(opt_n, *black_scholes_queue); - h_stock_price = sycl::malloc_shared(opt_n, *black_scholes_queue); - h_option_strike = sycl::malloc_shared(opt_n, *black_scholes_queue); - h_option_years = sycl::malloc_shared(opt_n, *black_scholes_queue); - - constexpr int rand_seed = 777; - namespace mkl_rng = oneapi::mkl::rng; - // create random number generator object - mkl_rng::philox4x32x10 engine( -#if !INIT_ON_HOST - *black_scholes_queue, -#else - sycl::queue{sycl::cpu_selector_v}, -#endif // !INIT_ON_HOST - rand_seed); - - sycl::event event_1 = mkl_rng::generate(mkl_rng::uniform(5.0, 50.0), engine, opt_n, h_stock_price); - sycl::event event_2 = mkl_rng::generate(mkl_rng::uniform(10.0, 25.0), engine, opt_n, h_option_strike); - sycl::event event_3 = mkl_rng::generate(mkl_rng::uniform(1.0, 5.0), engine, opt_n, h_option_years); - sycl::event::wait({event_1, event_2, event_3}); -} - -template -BlackScholes::~BlackScholes() -{ - sycl::free(h_call_result, *black_scholes_queue); - sycl::free(h_put_result, *black_scholes_queue); - sycl::free(h_stock_price, *black_scholes_queue); - sycl::free(h_option_strike, *black_scholes_queue); - sycl::free(h_option_years, *black_scholes_queue); - delete black_scholes_queue; -} - -template -void BlackScholes::run() -{ - std::printf("%s Precision Black&Scholes Option Pricing version %d.%d running on %s using DPC++, workgroup size %d, sub-group size %d.\n", - sizeof(DATA_TYPE) > 4 ? "Double" : "Single", MAJOR, MINOR, black_scholes_queue->get_device().get_info().c_str(), wg_size, sg_size); - - std::printf("Compiler Version: %s, LLVM %d.%d based.\n", __VERSION__, __clang_major__, __clang_minor__); - std::printf("Driver Version : %s\n", black_scholes_queue->get_device().get_info().c_str()); - std::printf("Build Time : %s %s\n", __DATE__, __TIME__); - std::printf("Input Dataset : %zu\n", opt_n); - size_t total_options = 2 * opt_n /*Pricing Call and Put options at the same time, so 2*num_options*/ * ITER_N; - - body(); - black_scholes_queue->wait(); - - std::printf("Pricing %zu Options in %d iterations, %zu Options in total.\n", 2 * opt_n, ITER_N, total_options); fflush(stdout); - timer t{}; - t.start(); - - for (int i = 0; i < ITER_N; i++) { - body(); - } - black_scholes_queue->wait(); - - t.stop(); - - std::printf("Completed in %10.5f seconds. GOptions per second: %10.5f\n", t.duration(), static_cast(total_options) / t.duration() / 1e9); - std::printf("Time Elapsed = %10.5f seconds\n", t.duration()); fflush(stdout); -} - -int main(int const argc, char const* argv[]) -{ - bool is_fp64 = true; - { - sycl::queue test_queue; - is_fp64 = test_queue.get_device().has(sycl::aspect::fp64); - } - if (is_fp64) { - BlackScholes test{}; - test.run(); - test.check(); - } else { - std::cout<<"Warning: could not find a device with double precision support. Single precision is used."< test{}; - test.run(); - test.check(); - } - - return 0; -} diff --git a/Libraries/oneMKL/black_scholes/third-party-programs.txt b/Libraries/oneMKL/black_scholes/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/black_scholes/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/block_cholesky_decomposition/GNUmakefile b/Libraries/oneMKL/block_cholesky_decomposition/GNUmakefile deleted file mode 100644 index 241e419a48..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/GNUmakefile +++ /dev/null @@ -1,18 +0,0 @@ -# Makefile for GNU make - -all: factor solve - ./factor - ./solve - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl="blas,lapack" - -factor: factor.cpp dpbltrf.cpp auxi.cpp - icpx $^ -o $@ -fsycl -fsycl-device-code-split=per_kernel $(MKL_COPTS) - -solve: solve.cpp dpbltrf.cpp dpbltrs.cpp auxi.cpp - icpx $^ -o $@ -fsycl -fsycl-device-code-split=per_kernel $(MKL_COPTS) - -clean: - -rm -f factor solve - -.PHONY: all clean diff --git a/Libraries/oneMKL/block_cholesky_decomposition/License.txt b/Libraries/oneMKL/block_cholesky_decomposition/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/block_cholesky_decomposition/README.md b/Libraries/oneMKL/block_cholesky_decomposition/README.md deleted file mode 100644 index cdf7bf297a..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# `Block Cholesky Decomposition` Sample - -Block Cholesky Decomposition shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) library's BLAS and LAPACK functionality to solve a symmetric, positive-definite block tridiagonal linear equation. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use oneMKL BLAS and LAPACK routines with pointer-based (USM) programming -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -Block Cholesky Decomposition consists of two small applications (`factor.cpp` and `solve.cpp`). The factor step generates a block tridiagonal matrix, then performs a block Cholesky factorization using oneMKL BLAS and LAPACK routines. The solver application uses this factorization to solve a linear system with the block tridiagonal matrix on the left-hand side. Both factoring and solving require several oneMKL routines. Some steps can be parallelized, while others must be ordered sequentially. - -The sample code shows how to inform oneMKL of the dependencies between routines using SYCL*-compliant events. The code uses pointer-based programming, with Unified Shared Memory (USM) throughout, which allows individual oneMKL routines to work on submatrices of the original matrices. - -This sample will use the default SYCL device. You can set the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - -This article explains in detail how to solve a system of linear equations with a Cholesky-factored symmetric positive definite block tridiagonal coefficient matrix: https://www.intel.com/content/www/us/en/docs/onemkl/cookbook/current/slve-lin-eqs-blck-tridag-symm-pos-def-coeff-mtrx.html. - -## Key Implementation Details - -This sample illustrates several important oneMKL routines: matrix multiplication, rank-k updates, and triangular solves from BLAS (`gemm`, `syrk`, and `trsm`), and Cholesky factorization (`potrf`) from LAPACK. - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - - -## Building the Block Cholesky Decomposition Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build and run the factor and solve programs. You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -> **Warning**: On Windows, static linking with oneMKL currently takes a very long time due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Block Cholesky Decomposition Sample - -### Example of Output -After building, if everything is working correctly, you will see the step-by-step output from the `factor` and `solve` programs. Each includes an accuracy check at the end to verify that the computation was successful. -``` -./factor -Testing accuracy of Cholesky factorization -of randomly generated positive definite symmetric -block tridiagonal matrix by calculating residual. - -Matrix size = 200 -Block size = 20 -... -Matrices are being generated. -... -Call Cholesky factorization -... -Cholesky factorization succeeded. -Testing the residual -... -Residual test -||A-L*L^t||_F/||A||_F <= 5*EPS... -passed - -./solve -Testing accuracy of the solution of linear equations system -with randomly generated positive definite symmetric -block tridiagonal coefficient matrix by calculating -ratios of residuals to RHS vectors' norms. -... -Matrices are being generated. -... -Call Cholesky factorization -... -Cholesky factorization succeeded. -Call solving the system of linear equations -... -Solution succeeded. -The system is solved. Testing the residual -... -Residual test -max_(i=1,...,NRHS){||A*X(i)-F(i)||/||F(i)||} <= 10*EPS -passed -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/block_cholesky_decomposition/auxi.cpp b/Libraries/oneMKL/block_cholesky_decomposition/auxi.cpp deleted file mode 100644 index f3fef9bca1..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/auxi.cpp +++ /dev/null @@ -1,292 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* Content: -* Auxiliary subroutines for: -* - Testing accuracy of Cholesky factorization by computing ratio -* ||A-L*L^t||_F/||A||_F of Frobenius norms of the residual to the -* Frobenius norm of the initial matrix and comparing it to 5*EPS. -* - Calculating max_(i=1,...,NRHS){||AX(i)-F(i)||/||F(i)||} of -* ratios of residuals to norms of RHS vectors for a system of -* linear equations with tridiagonal coefficient matrix and -* multiple RHS -* -***********************************************************************/ -#include -#include -#include -#include -#include -#include "mkl.h" - - -/************************************************************************ -* Definition: -* =========== -* double test_res(int64_t n, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* d1, int64_t ldd1, double* b1, int64_t ldb1, double* d2, int64_t ldd2, double* b2, int64_t ldb2) -* -* Purpose: -* ======== -* Given L*L^t factorization of block tridiagonal matrix A TEST_RES -* computes ratio ||A-L*L^t||_F/||A||_F of Frobenius norm of the residual -* to the Frobenius norm of the initial matrix. The test is considered as -* passed if the ratio does not exceed 5*EPS. The result is returned via -* value of INFO. -* -* Arguments: -* ========== -* N (input) int64_t -* The number of block rows of the matrix A. N > 0. -* -* NB (input) int64_t -* The size of blocks. NB > 0. -* -* D (input) double array, dimension (LDD) * (N*NB) -* The array stores N diagonal blocks (each of size NB by NB) -* of the triangular factor L if factorized matrix. The blocks -* are stored sequentially block by block. -* Caution: upper triangles of diagonal blocks are not zeroed* -* ======= -* -* LDD (input) int64_t. -* The leading dimension of the array D, LDD >= NB -* -* B (input) double array, dimension (LDB,(N-1)*NB) -* The array stores sub-diagonal blocks of triangular factor L. -* The blocks are stored sequentially block by block. -* -* LDB (input) int64_t. -* The leading dimension of the array B, LDB >= NB -* -* D1 (work array) double array, dimension (LDD1,N*NB) -* The array is destined for internal computations. -* -* LDD1 (input) int64_t. -* The leading dimension of the array D1, LDD1 >= NB -* -* B1 (work array) double array, dimension (LDB1,(N-1)*NB) -* The array is destined for internal computations. -* -* LDB1 (input) int64_t. -* The leading dimension of the array B1, LDB1 >= NB -* -* D2 (input) double array, dimension (LDD2,N*NB) -* The array stores N diagonal blocks (each of size NB by NB) -* of the initial symmetric positive definite matrix A. -* The blocks are stored sequentially block by block. The -* array is used for comparison. -* -* LDD2 (input) int64_t. -* The leading dimension of the array D2, LDD2 >= NB -* -* B2 (input) double array, dimension (LDB2,(N-1)*NB) -* The array stores sub-diagonal blocks of the initial symmetric -* positive definite matrix A. The blocks are stored -* sequentially block by block. The array is used for comparison. -* -* LDB2 (input) int64_t. -* The leading dimension of the array B2, LDB2 >= NB -* -* INFO (output) int64_t -* = 0: successful exit -* < 0: if INFO = -i, the i-th argument had an illegal value -* = 1: the ratio ||A-L*L^t||_F/||A||_F exceeds 5*EPS -***********************************************************************/ - -double test_res(int64_t n, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* d1, int64_t ldd1, double* b1, int64_t ldb1, double* d2, int64_t ldd2, double* b2, int64_t ldb2) { - - // Matrix accessors - auto D = [=](int64_t i, int64_t j) -> double& { return d[i + j*ldd]; }; - auto D1 = [=](int64_t i, int64_t j) -> double& { return d1[i + j*ldd1]; }; - auto D2 = [=](int64_t i, int64_t j) -> double& { return d2[i + j*ldd2]; }; - auto B = [=](int64_t i, int64_t j) -> double& { return b[i + j*ldb]; }; - auto B1 = [=](int64_t i, int64_t j) -> double& { return b1[i + j*ldb1]; }; - auto B2 = [=](int64_t i, int64_t j) -> double& { return b2[i + j*ldb2]; }; - - // Compute S2 = ||A||_F - double s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*n, d2, ldd2); - double s1 = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*(n-1), b2, ldb2); - double s2 = sqrt(s*s+2.0*s1*s1); - - // Copy D -> D1, B -> B1 and nullify the upper triangle of blocks in D1 - for (int64_t k = 0; k < n; k++) { - for(int64_t j = 0; j < nb; j++) { - cblas_dcopy(nb-j, &D(j, k*nb+j), 1, &D1(j, k*nb+j), ldd1); - for (int64_t i = 0; i < j; i++) { - D1(j, k*nb+i) = 0.0; - } - } - } - - for (int64_t k = 0; k < n-1; k++) { - for (int64_t j = 0; j < nb; j++) { - cblas_dcopy(nb, &B(0, k*nb+j), 1, &B1(0, k*nb+j), 1); - } - } - - // Compute product of lower block bidiagonal matrix by its transpose - // | L_1 | | L_1^t B_1^t | - // | B_1 L_2 | | L_2^t B_2^t | - // | . . |*| . . | - // | . . | | . . | - // | B_N-2 L_N-1 | | L_N-1^t B_N-1^t| - // | B_N-1 L_N | | L_N^t | - // - // Result matrix has the following structure - // D_1 B_1^t - // B_1 D_2 B_2^t - // B_2 D_3 B_3^t - // . . . - // . . . - // B_N-2 D_N-1 B_N-1^t - // B_N-1 D_N - // - // D_1 := L_1*L_1^t - cblas_dtrmm(CblasColMajor, CblasLeft, CblasLower, CblasNoTrans, CblasNonUnit, nb, nb, 1.0, d, ldd, d1, ldd1); - for (int64_t k = 0; k < n-1; k++) { - // B_k := B_k*L_k^t - cblas_dtrmm(CblasColMajor, CblasRight, CblasLower, CblasTrans, CblasNonUnit, - nb, nb, 1.0, &D(0, k*nb), ldd, &B1(0, k*nb), ldb1); - // D_k := L_k*L_k^t - cblas_dtrmm(CblasColMajor, CblasLeft, CblasLower, CblasNoTrans, CblasNonUnit, - nb, nb, 1.0, &D(0, (k+1)*nb), ldd, &D1(0, (k+1)*nb), ldd1); - // D_k := D_k + B_k*B_k^t - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans, nb, nb, nb, 1.0, - &B(0, k*nb), ldb, &B(0, k*nb), ldb, 1.0, - &D1(0, (k+1)*nb), ldd1); - } - - // Compute the difference between the calculated product L*L^t and initial - // matrix that was factored - for (int64_t j = 0; j < nb*n; j++) { - for (int64_t i = 0; i < nb; i++) { - D1(i,j) = D1(i,j) - D2(i,j); - } - } - - for (int64_t j = 0; j < nb*(n-1); j++) { - for (int64_t i = 0; i < nb; i++) { - B1(i,j) = B1(i,j) - B2(i,j); - } - } - - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*n, d1, ldd1); - s1 = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*(n-1), b1, ldb1); - - s = sqrt(s*s+2.0*s1*s1)/s2; - return s; -} - -/************************************************************************ -* Definition: -* =========== -* double test_res1(int64_t n, int64_t nrhs, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* f, int64_t ldf, double* x, int64_t ldx ) -* -* Purpose: -* ======== -* Given approximate solution X of system of linear equations A*X=F -* with symmetric positive definite block tridiagonal coefficient matrix -* A = -* D_1 B_1^t -* B_1 D_2 B_2^t -* B_2 D_3 B_3^t -* . . . -* . . . -* B_N-2 D_N-1 B_N-1^t -* B_N-1 D_N -* the routine computes max_(i=1,...,NRHS){||AX(i)-F(i)||/F(i)} of ratios -* of residuals to norms of RHS vectors. he test is considered as passed -* if the value does not exceed 10*EPS where EPS is the machine -* precision. -* -* Arguments: -* ========== -* N (input) int64_t -* The number of block rows of the matrix A. N > 0. -* -* NRHS (input) int64_t -* The number of right hand sides (number of columns in matrix F. -* -* NB (input) int64_t -* The block size of blocks D_j, B_j -* -* D (input) double array, dimension (LDD) * (N*NB) -* The array stores N diagonal blocks (each of size NB by NB) -* of matrix A. The blocks are stored sequentially block by -* block. -* Caution: The diagonal blocks are symmetric matrices - this -* ======= -* feature is assumed. -* -* LDD (input) int64_t. -* The leading dimension of the array D, LDD >= NB -* -* B (input) double array, dimension (LDB) * ((N-1)*NB) -* The array stores sub-diagonal blocks of matrix A. -* The blocks are stored sequentially block by block. -* -* LDB (input) int64_t. -* The leading dimension of the array B, LDB >= NB -* -* F (input) double array, dimension (LDF) * (NRHS) -* The right hand sides of the system of linear equations. -* -* LDF (input) int64_t. -* The leading dimension of the array F, LDF >= NB*N -* -* X (input) double array, dimension (LDX) * (NRHS) -* The solutions of the system of linear equations. -* -* LDX (input) int64_t. -* The leading dimension of the array X, LDX >= NB*N -* -* INFO (output) int64_t -* = 0: successful exit -* < 0: if INFO = -i, the i-th argument had an illegal value -* = 1: max_(i=1,...,NRHS){||AX(i)-F(i)||/F(i)} exceeds 10*EPS -* = 10: note enough memory for internal array -***********************************************************************/ - -double test_res1(int64_t n, int64_t nrhs, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* f, int64_t ldf, double* x, int64_t ldx ) { - - // Matrix accessors - auto D = [=](int64_t i, int64_t j) -> double& { return d[i + j*ldd]; }; - auto B = [=](int64_t i, int64_t j) -> double& { return b[i + j*ldb]; }; - auto F = [=](int64_t i, int64_t j) -> double& { return f[i + j*ldf]; }; - auto X = [=](int64_t i, int64_t j) -> double& { return x[i + j*ldx]; }; - - std::vector norms(nrhs); - - // Compute norms of RHS vectors - for (int64_t i = 0; i < nrhs; i++) { - norms[i] = cblas_dnrm2(nb*n, &F(0,i), 1); - } - - // Out-of-loop compute F(1):=F(1)-D(1)*X(1)-B(1)^t*X(2) - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, d, ldd, x, ldx, 1.0, f, ldf); - cblas_dgemm(CblasColMajor, CblasTrans, CblasNoTrans, nb, nrhs, nb, -1.0, b,ldb, &X(nb, 0), ldx, 1.0, f, ldf); - - for (int64_t k = 1; k < n-1; k++) { - // Compute F(K):=F(K)-B(K-1)*X(K-1)-D(K)*X(K)-B(K)^t*X(K+1) - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &B(0, (k-1)*nb), ldb, &X((k-1)*nb, 0), ldx, 1.0, &F(k*nb, 0), ldf); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &D(0, k*nb), ldd, &X( k*nb, 0), ldx, 1.0, &F(k*nb, 0), ldf); - cblas_dgemm(CblasColMajor, CblasTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &B(0, k*nb), ldb, &X((k+1)*nb, 0), ldx, 1.0, &F(k*nb, 0), ldf); - } - - // Out-of-loop compute F(N):=F(N)-B(N-1)*X(N-1)-D(N)*X(N) - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &B(0, (n-2)*nb), ldb, &X((n-2)*nb, 0), ldx, 1.0, &F((n-1)*nb, 0), ldf); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &D(0, (n-1)*nb), ldd, &X((n-1)*nb, 0), ldx, 1.0, &F((n-1)*nb, 0), ldf); - - // Compute norms of residual vectors divided by norms of RHS vectors - double res = 0.0; - for (int64_t i = 0; i < nrhs; i++) { - double s = cblas_dnrm2(n*nb, &F(0,i), 1); - res = std::max(res, s/norms[i]); - } - - return res; -} diff --git a/Libraries/oneMKL/block_cholesky_decomposition/dpbltrf.cpp b/Libraries/oneMKL/block_cholesky_decomposition/dpbltrf.cpp deleted file mode 100644 index cca2d64392..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/dpbltrf.cpp +++ /dev/null @@ -1,173 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* Function DPBLTRF for Cholesky factorization of symmetric -* positive definite block tridiagonal matrix. -************************************************************************/ -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -/************************************************************************ -* Definition: -* =========== -* int64_t dpbltrf(sycl::queue queue, int64_t n, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb) { -* -* Purpose: -* ======== -* DPBLTRF computes Cholesky L*L^t-factorization of symmetric positive -* definite block tridiagonal matrix A -* D_1 B_1^t -* B_1 D_2 B_2^t -* B_2 D_3 B_3^t -* . . . -* . . . -* B_N-2 D_N-1 B_N-1^t -* B_N-1 D_N -* The factorization has the form A = L*L**t, where L is a lower -* bidiagonal block matrix -* L_1 -* C_1 L_2 -* C_2 L_3 -* . . . -* . . . -* C_N-2 L_N-1 -* C_N-1 L_N -* This is a block version of LAPACK DPTTRF subroutine. -* -* Arguments: -* ========== -* QUEUE (input) sycl queue -* The device queue -* -* N (input) int64_t -* The number of block rows of the matrix A. N >= 0. -* -* NB (input) int64_t -* The size of blocks. NB >= 0. -* -* D (input/output) double array, dimension (LDD)*(N*NB) -* On entry, the array stores N diagonal blocks (each of size NB by -* NB) of the matrix to be factored. The blocks are stored -* sequentially: first NB columns of D store block D_1, second NB -* columns store block D_2,...,last NB columns store block D_N. -* Note: As the diagonal blocks are symmetric only lower or upper -* ==== -* triangle is needed to store blocks' elements. In this code -* lower storage is used*** -* On exit, the array stores diagonal blocks of triangular factor L. -* Diagonal blocks of lower triangular factor L replace -* respective lower triangles of blocks D_j (1 <= j <= N). -* Caution: upper triangles of diagonal blocks are not zeroed on exit -* -* LDD (input) int64_t -* The leading dimension of array D. LDD >= NB. -* -* B (input/output) double array, dimension (LDB)*((N-1)*NB) -* On entry, the array stores sub-diagonal blocks (each of size NB -* by NB) of the matrix to be factored. The blocks are stored -* sequentially: first NB columns of B store block B_1, second -* NB columns store block B_2,...,last NB columns store block -* B_N-1. -* On exit, the array stores sub-diagonal blocks of triangular factor -* L. -* -* LDB (input) int64_t -* The leading dimension of array B. LDB >= NB. -* -* INFO (return) int64_t -* = 0: successful exit -* < 0: if INFO = -i, the i-th argument had an illegal value -* > 0: if INFO = i, the leading minor of order i (and -* therefore the matrix A itself) is not -* positive-definite, and the factorization could not be -* completed. This may indicate an error in forming the -* matrix A. -***********************************************************************/ -int64_t dpbltrf(sycl::queue queue, int64_t n, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb) { - - // Matrix accessors - auto D = [=](int64_t i, int64_t j) -> double& { return d[(i) + (j)*ldd]; }; - auto B = [=](int64_t i, int64_t j) -> double& { return b[(i) + (j)*ldb]; }; - - int64_t info = 0; - if (n < 0) - info = -1; - else if (nb < 0) - info = -2; - else if (ldd < nb) - info = -4; - else if (ldb < nb) - info = -6; - - if (info) - return info; - - sycl::context context = queue.get_context(); - sycl::device device = queue.get_device(); - - // Compute Cholesky factorization of the first diagonal block - try { - std::int64_t scratchpad_size = mkl::lapack::potrf_scratchpad_size(queue, mkl::uplo::lower, nb, ldd); - double* scratchpad = static_cast(sycl::malloc_shared(scratchpad_size * sizeof(double), device, context)); - if (scratchpad_size != 0 && !scratchpad) { - info = -1000; - goto cleanup; - } - auto event1 = mkl::lapack::potrf(queue, mkl::uplo::lower, nb, d, ldd, scratchpad, scratchpad_size ); - event1.wait_and_throw(); - sycl::free(scratchpad, context); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to LAPACK API:\ninfo: " << e.info() << std::endl; - if (e.info() > 0) { - // INFO is equal to the 'global' index of the element u_ii of the factor - // U which is equal to zero - info = e.info(); - } - return info; - } - - // Main loop - for (int64_t k = 0; k < n-1; k++) { - auto event1 = mkl::blas::trsm(queue, mkl::side::right, mkl::uplo::lower, mkl::transpose::trans, - mkl::diag::nonunit, nb, nb, 1.0, &D(0,k*nb), ldd, &B(0,k*nb), ldb); - auto event2 = mkl::blas::syrk(queue, mkl::uplo::lower, mkl::transpose::nontrans, nb, nb, - -1.0, &B(0,k*nb), ldb, 1.0, &D(0,(k+1)*nb), ldd, {event1}); - event2.wait_and_throw(); - - try { - std::int64_t scratchpad_size = mkl::lapack::potrf_scratchpad_size(queue, mkl::uplo::lower, nb, ldd); - double* scratchpad = static_cast(sycl::malloc_shared(scratchpad_size * sizeof(double), device, context)); - if (scratchpad_size != 0 && !scratchpad) { - info = -1000; - goto cleanup; - } - auto event1 = mkl::lapack::potrf(queue, mkl::uplo::lower, nb, &D(0,(k+1)*nb), ldd, scratchpad, scratchpad_size ); - event1.wait_and_throw(); - sycl::free(scratchpad, context); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to LAPACK API:\ninfo: " << e.info() << std::endl; - if (e.info() > 0) { - // INFO is equal to the 'global' index of the element u_ii of the factor - // U which is equal to zero - info = e.info() + (k+1)*nb; - } - return info; - } - } - return info; - -cleanup: - return info; -} diff --git a/Libraries/oneMKL/block_cholesky_decomposition/dpbltrs.cpp b/Libraries/oneMKL/block_cholesky_decomposition/dpbltrs.cpp deleted file mode 100644 index fc956641d6..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/dpbltrs.cpp +++ /dev/null @@ -1,135 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* Function DPBLTRS for solving a system of linear equations with -* Cholesky factored symmetric positive definite block tridiagonal -* coefficient matrix. -************************************************************************/ -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -/************************************************************************ -* Definition: -* =========== -* int64_t dpbltrs(sycl::queue queue, int64_t n, int64_t nrhs, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* f, int64_t ldf) -* -* Purpose: -* ======== -* DPBLTRS computes a solution to system of linear equations A*X=F with -* symmetric positive definite block tridiagonal coefficient matrix A -* D_1 B_1^t -* B_1 D_2 B_2^t -* B_2 D_3 B_3^t -* . . . -* . . . -* B_N-2 D_N-1 B_N-1^t -* B_N-1 D_N -* and multiple right hand sides F. Before call this routine the -* coefficient matrix should factored A=L*L^T by calling DPBLTRF where -* L is a lower block bidiagonal matrix -* L_1 -* C_1 L_2 -* C_2 L_3 -* . . . -* . . . -* C_N-2 L_N-1 -* C_N-1 L_N -* This is a block version of LAPACK DPTTRS subroutine. -* -* Arguments: -* ========== -* QUEUE (input) sycl queue -* The device queue -* -* N (input) int64_t -* The number of block rows of the matrix A. N >= 0. -* -* NRHS (input) int64_t -* The number of right hand sides (the number of columns in matrix F). -* -* NB (input) int64_t -* The size of blocks. NB >= 0. -* -* D (input) double array, dimension (LDD) * (N*NB) -* On entry, the array stores diagonal blocks of triangular factor L. -* Diagonal blocks L_j of lower triangular factor L are stored as -* respective lower triangles of blocks D_j (1 <= j <= N). -* Caution: upper triangles of D_j are not assumed to be zeroed. -* ======= -* -* LDD (input) int64_t -* The leading dimension of array D. LDD >= NB. -* -* B (input) double array, dimension (LDB) * ((N-1)*NB) -* On entry, the array stores sub-diagonal blocks L_j of triangular -* factor L. -* -* LDB (input) int64_t -* The leading dimension of array B. LDB >= NB. -* -* F (input/output) double array, dimension (LDF) * (NRHS) -* On entry, the columns of the array store vectors F(i) of right -* hand sides of system of linear equations A*X=F. -* -* LDF (input) int64_t -* The leading dimension of array F. LDF >= NB*N. -* -* INFO (return) int64_t -* = 0: successful exit -* < 0: if INFO = -i, the i-th argument had an illegal value -* ===================================================================== -*/ -int64_t dpbltrs(sycl::queue queue, int64_t n, int64_t nrhs, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* f, int64_t ldf) { - - auto D = [=](int64_t i, int64_t j) -> double& { return d[i + j*ldd]; }; - auto B = [=](int64_t i, int64_t j) -> double& { return b[i + j*ldb]; }; - auto F = [=](int64_t i, int64_t j) -> double& { return f[i + j*ldf]; }; - - // Test the input arguments. - int64_t info = 0; - if (n < 0) - info = -1; - else if (nrhs < 0) - info = -2; - else if (nb < 0) - info = -3; - else if (ldd < nb) - info = -5; - else if (ldb < nb) - info = -7; - else if (ldf < nb*n) - info = -9; - - if (info) - return info; - - // Solving the system of linear equations L*Y=F - auto event1 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::nontrans, mkl::diag::nonunit, nb, nrhs, 1.0, d, ldd, f, ldf); - event1.wait_and_throw(); - for ( int64_t k = 0; k < n-1; k++) { - auto event2 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &B(0, k*nb), ldb, &F(k*nb, 0), ldf, 1.0, &F((k+1)*nb, 0), ldf); - auto event3 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::nontrans, mkl::diag::nonunit, nb, nrhs, 1.0, &D(0, (k+1)*nb), ldd, &F((k+1)*nb, 0), ldf, {event2}); - event3.wait_and_throw(); - } - // .. - // Solving the system of linear equations L^T*X=Y - event1 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::trans, mkl::diag::nonunit, nb, nrhs, 1.0, &D(0, (n-1)*nb), ldd, &F((n-1)*nb, 0), ldf); - event1.wait_and_throw(); - for ( int64_t k = n-2; k >= 0; k-- ) { - auto event2 = mkl::blas::gemm(queue, mkl::transpose::trans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &B(0, k*nb), ldb, &F((k+1)*nb, 0), ldf, 1.0, &F(k*nb, 0), ldf); - auto event3 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::trans, mkl::diag::nonunit, nb, nrhs, 1.0, &D(0, k*nb), ldd, &F(k*nb, 0), ldf, {event2}); - event3.wait_and_throw(); - } - - return info; -} diff --git a/Libraries/oneMKL/block_cholesky_decomposition/factor.cpp b/Libraries/oneMKL/block_cholesky_decomposition/factor.cpp deleted file mode 100644 index 928b66e8c3..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/factor.cpp +++ /dev/null @@ -1,157 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* - * - * Content: - * Example of Cholesky factorization of a symmetric positive - * definite block tridiagonal matrix - ************************************************************************ - * Purpose: - * ======== - * Testing accuracy of Cholesky factorization A= - * | L_1 | | L_1^t C_1^t | - * | C_1 L_2 | | L_2^t C_2^t | - * A = | . . |*| . . | - * | . . | | . C_N-1^t | - * | C_N-1 L_N | | L_N^t | - * - * of a symmetric positive definite block tridiagonal matrix A - * | D_1 B_1^t | - * | B_1 D_2 B_2^t | - * | B_2 D_3 B_3^t | - * | . . . | - * | . . . | - * | B_N-2 D_N-1 B_N-1^t | - * | B_N-1 D_N | - * by calling TEST_RES which calculates ratio of Frobenius norms - * ||A-L*L^t||_F/||A||_F. - */ - -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -int64_t dpbltrf(sycl::queue queue, int64_t n, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb); -double test_res(int64_t, int64_t, double*, int64_t, double*, int64_t, double*, int64_t, double*, int64_t, double*, int64_t, double*, int64_t); - -template -using allocator_t = sycl::usm_allocator; - - -int main() { - - if (sizeof(MKL_INT) != sizeof(int64_t)) { - std::cerr << "MKL_INT not 64bit" << std::endl; - return -1; - } - - int64_t info = 0; - - // Asynchronous error handler - auto error_handler = [&] (sycl::exception_list exceptions) { - for (auto const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during asynchronous call - info = e.info(); - std::cout << "Unexpected exception caught during asynchronous LAPACK operation:\ninfo: " << e.info() << std::endl; - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during asynchronous call - std::cout << "Unexpected exception caught during asynchronous operation:\n" << e.what() << std::endl; - info = -1; - } - } - }; - - sycl::device device{sycl::default_selector_v}; - sycl::queue queue(device, error_handler); - sycl::context context = queue.get_context(); - - if (device.get_info().empty()) { - std::cerr << "The sample uses double precision, which is not supported" << std::endl; - std::cerr << "by the selected device. Quitting." << std::endl; - return 0; - } - - allocator_t allocator_d(context, device); - - MKL_INT n = 200; - MKL_INT nb = 20; - - std::vector> d(nb * n*nb, allocator_d); - std::vector> b(nb * (n-1)*nb, allocator_d); - std::vector d1(nb * n*nb); - std::vector b1(nb * (n-1)*nb); - std::vector d2(nb * n*nb); - std::vector b2(nb * (n-1)*nb); - - std::vector iseed = {1, 2, 33, 15}; - - auto D = [=,&d](int64_t i, int64_t j) -> double& { return d[i + j*nb]; }; - - std::cout << "Testing accuracy of Cholesky factorization\n"; - std::cout << "of randomly generated positive definite symmetric\n"; - std::cout << "block tridiagonal matrix by calculating residual.\n\n"; - std::cout << "Matrix size = " << n << "\n"; - std::cout << "Block size = " << nb << "\n"; - std::cout << "...\n"; - std::cout << "Matrices are being generated.\n"; - std::cout << "...\n"; - - // Initializing arrays randomly - LAPACKE_dlarnv(2, iseed.data(), (n-1)*nb*nb, b.data()); - cblas_dcopy((n-1)*nb*nb, b.data(), 1, b2.data(), 1); - for (int64_t k = 0; k < n; k++) { - for (int64_t j = 0; j < nb; j++) { - LAPACKE_dlarnv(2, iseed.data(), nb-j, &D(j,k*nb+j)); - cblas_dcopy(nb-j, &D(j+1, k*nb+j), 1, &D(j, k*nb+j+1), nb); - } - // Diagonal dominance to make the matrix positive definite - for (int64_t j = 0; j < nb; j++) { - D(j, k*nb+j) += nb*3.0; - } - } - cblas_dcopy(n*nb*nb, d.data(), 1, d2.data(), 1); - - std::cout << "Call Cholesky factorization\n"; - std::cout << "...\n"; - try { - info = dpbltrf(queue, n, nb, d.data(), nb, b.data(), nb); - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to SYCL API:\n" << e.what() << std::endl; - info = -1; - } - - if(info) { - std::cout << "Factorization failed. info = " << info << std::endl; - return 1; - } else { - std::cout << "Cholesky factorization succeeded." << std::endl; - std::cout << "Testing the residual" << std::endl; - std::cout << "..." << std::endl; - double res = test_res(n, nb, d.data(), nb, b.data(), nb, d1.data(), nb, b1.data(), nb, d2.data(), nb, b2.data(), nb); - double eps = LAPACKE_dlamch('E'); - - std::cout << "Residual test" << std::endl; - std::cout << "||A-L*L^t||_F/||A||_F <= 5*EPS..." << std::endl; - if (res/eps > 5.0) { - std::cout << "failed: ||A-L*L^t||_F/||A||_F = " << res << std::endl; - return 1; - } else { - std::cout << "passed" << std::endl; - } - } - - return 0; -} diff --git a/Libraries/oneMKL/block_cholesky_decomposition/makefile b/Libraries/oneMKL/block_cholesky_decomposition/makefile deleted file mode 100644 index b526884f63..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Makefile for NMAKE - -all: factor.exe solve.exe - .\factor.exe - .\solve.exe - -DPCPP_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl="blas,lapack" /DMKL_ILP64 /EHsc -fsycl-device-code-split=per_kernel OpenCL.lib - -factor.exe: factor.cpp dpbltrf.cpp auxi.cpp - icx-cl -fsycl factor.cpp dpbltrf.cpp auxi.cpp /Fefactor.exe $(DPCPP_OPTS) - -solve.exe: solve.cpp dpbltrf.cpp dpbltrs.cpp auxi.cpp - icx-cl -fsycl solve.cpp dpbltrf.cpp dpbltrs.cpp auxi.cpp /Fesolve.exe $(DPCPP_OPTS) - -clean: - del /q factor.exe factor.exp factor.lib solve.exe solve.exp solve.lib diff --git a/Libraries/oneMKL/block_cholesky_decomposition/sample.json b/Libraries/oneMKL/block_cholesky_decomposition/sample.json deleted file mode 100644 index 75ae809fbd..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "54F991CC-F04C-443A-9C3E-0AAF98A8FD65", - "name": "Block Cholesky Decomposition", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Block Cholesky Decomposition using Intel® oneMKL BLAS and LAPACK", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "block_cholesky_decomposition", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "block_cholesky_decomposition", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/block_cholesky_decomposition/solve.cpp b/Libraries/oneMKL/block_cholesky_decomposition/solve.cpp deleted file mode 100644 index 4bac877248..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/solve.cpp +++ /dev/null @@ -1,182 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* Content: -* Example of solving a system of linear equations with symmetric -* positive definite block tridiagonal coefficient matrix Cholesky -* factored -************************************************************************ -* Purpose: -* ======== -* Testing accuracy of solution of a system of linear equations A*X=F -* with a symmetric positive definite block tridiagonal coefficient -* matrix A -* | D_1 B_1^t | -* | B_1 D_2 B_2^t | -* | B_2 D_3 B_3^t | -* | . . . | -* | . . . | -* | B_N-2 D_N-1 B_N-1^t | -* | B_N-1 D_N | -* preliminarily Cholesky factored as follows: -* | L_1 | | L_1^t C_1^t | -* | C_1 L_2 | | L_2^t C_2^t | -* A = | . . |*| . . | -* | . . | | . C_N-1^t | -* | C_N-1 L_N | | L_N^t | -* -* To test the solution function TES_RES1 is called. -*/ - -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -template -using allocator_t = sycl::usm_allocator; - -int64_t dpbltrf(sycl::queue queue, int64_t n, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb); -int64_t dpbltrs(sycl::queue queue, int64_t n, int64_t nrhs, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* f, int64_t ldf); - -double test_res1(int64_t n, int64_t nrhs, int64_t nb, double* d, int64_t ldd, double* b, int64_t ldb, double* f, int64_t ldf, double* x, int64_t ldx ); - -int main() { - - if (sizeof(MKL_INT) != sizeof(int64_t)) { - std::cerr << "MKL_INT not 64bit" << std::endl; - return -1; - } - - int64_t info = 0; - - // Asynchronous error handler - auto error_handler = [&] (sycl::exception_list exceptions) { - for (auto const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during asynchronous call - info = e.info(); - std::cout << "Unexpected exception caught during asynchronous LAPACK operation:\ninfo: " << e.info() << std::endl; - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during asynchronous call - std::cout << "Unexpected exception caught during asynchronous operation:\n" << e.what() << std::endl; - info = -1; - } - } - }; - - sycl::device device{sycl::default_selector_v}; - sycl::queue queue(device, error_handler); - sycl::context context = queue.get_context(); - - if (device.get_info().empty()) { - std::cerr << "The sample uses double precision, which is not supported" << std::endl; - std::cerr << "by the selected device. Quitting." << std::endl; - return 0; - } - - allocator_t allocator_d(context, device); - - int64_t n = 200; - int64_t nb = 20; - int64_t nrhs = 10; - int64_t ldf = nb*n; - - - std::vector> d(nb * n*nb, allocator_d); - std::vector> b(nb * (n-1)*nb, allocator_d); - std::vector> f(ldf * nrhs, allocator_d); - std::vector d2(nb * n*nb); - std::vector b2(nb * (n-1)*nb); - std::vector f2(ldf * nrhs); - - auto D = [=,&d](int64_t i, int64_t j) -> double& { return d[i + j*nb]; }; - - std::vector iseed = {1, 2, 3, 19}; - - - std::cout << "Testing accuracy of solution of linear equations system" << std::endl; - std::cout << "with randomly generated positive definite symmetric" << std::endl; - std::cout << "block tridiagonal coefficient matrix by calculating" << std::endl; - std::cout << "ratios of residuals to RHS vectors' norms." << std::endl; - std::cout << "..." << std::endl; - - std::cout << "Matrices are being generated." << std::endl; - std::cout << "..." << std::endl; - - // Initializing arrays randomly - LAPACKE_dlarnv(2, iseed.data(), (n-1)*nb*nb, b.data()); - cblas_dcopy((n-1)*nb*nb, b.data(), 1, b2.data(), 1); - LAPACKE_dlarnv(2, iseed.data(), nrhs*ldf, f.data()); - cblas_dcopy(nrhs*ldf, f.data(), 1, f2.data(), 1); - - for (int64_t k = 0; k < n; k++) { - for (int64_t j = 0; j < nb; j++) { - LAPACKE_dlarnv(2, iseed.data(), nb-j, &D(j, k*nb+j)); - cblas_dcopy(nb-j-1, &D(j+1, k*nb+j), 1, &D(j, k*nb+j+1), nb); - } - // Diagonal dominance to make the matrix positive definite - for (int64_t j = 0; j < nb; j++) { - D(j, k*nb+j) += nb*3.0; - } - } - cblas_dcopy(nb*nb*n, d.data(), 1, d2.data(), 1); - - // Factor the coefficient matrix - std::cout << "Call Cholesky factorization" << std::endl; - std::cout << "..." << std::endl; - - try { - info = dpbltrf(queue, n, nb, d.data(), nb, b.data(), nb); - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to SYCL API:\n" << e.what() << std::endl; - info = -1; - } - if(info) { - std::cout << "Cholesky factorization failed. INFO = " << info << std::endl; - return 1; - } else { - std::cout << "Cholesky factorization succeeded." << std::endl; - } - - // Solve the system of equations with factored coefficient matrix - std::cout << "Call solving the system of linear equations" << std::endl; - std::cout << "..." << std::endl; - - info = dpbltrs(queue, n, nrhs, nb, d.data(), nb, b.data(), nb, f.data(), ldf); - if(info) { - std::cout << "Solution failed. INFO= " << info << std::endl; - return 1; - } else { - std::cout << "Solution succeeded." << std::endl; - } - - // Test the accuracy of the solution - std::cout << "The system is solved. Testing the residual" << std::endl; - std::cout << "..." << std::endl; - double res = test_res1(n, nrhs, nb, d2.data(), nb, b2.data(), nb, f2.data(), ldf, f.data(), ldf); - double eps = LAPACKE_dlamch('E'); - if(res/eps > 10.0) { - std::cout << "Residual test" << std::endl; - std::cout << "max_(i=1,...,NRHS){||A*X(i)-F(i)||/||F(i)||} <= 10*EPS " << std::endl; - std::cout << "failed" << std::endl; - return 1; - } else { - std::cout << "Residual test" << std::endl; - std::cout << "max_(i=1,...,NRHS){||A*X(i)-F(i)||/||F(i)||} <= 10*EPS " << std::endl; - std::cout << "passed" << std::endl; - } - - return 0; -} diff --git a/Libraries/oneMKL/block_cholesky_decomposition/third-party-programs.txt b/Libraries/oneMKL/block_cholesky_decomposition/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/block_cholesky_decomposition/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/block_lu_decomposition/GNUmakefile b/Libraries/oneMKL/block_lu_decomposition/GNUmakefile deleted file mode 100644 index 04e845c34a..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/GNUmakefile +++ /dev/null @@ -1,18 +0,0 @@ -# Makefile for GNU make - -all: factor solve - ./factor - ./solve - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl="blas,lapack" - -factor: factor.cpp dgeblttrf.cpp auxi.cpp - icpx $^ -o $@ -fsycl -fsycl-device-code-split=per_kernel $(MKL_COPTS) - -solve: solve.cpp dgeblttrf.cpp dgeblttrs.cpp auxi.cpp - icpx $^ -o $@ -fsycl -fsycl-device-code-split=per_kernel $(MKL_COPTS) - -clean: - -rm -f factor solve genxir - -.PHONY: clean all diff --git a/Libraries/oneMKL/block_lu_decomposition/License.txt b/Libraries/oneMKL/block_lu_decomposition/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/block_lu_decomposition/README.md b/Libraries/oneMKL/block_lu_decomposition/README.md deleted file mode 100644 index e94bd3c431..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# `Block LU Decomposition` Sample -Block LU Decomposition shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) BLAS and LAPACK functionality to solve a block tridiagonal linear equation. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use oneMKL BLAS and LAPACK routines with pointer-based (USM) programming -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose -Block LU Decomposition consists of two small applications (`factor.cpp` and `solve.cpp`). -The factor.cpp generates a tridiagonal block matrix, then performs a block LU factorization using oneMKL BLAS and LAPACK routines. The solve.cpp application uses this factorization to solve a linear system with the block tridiagonal matrix on the left-hand side. -Both factoring and solving require several oneMKL routines. Some steps can be parallelized, while others must be ordered sequentially. The sample code shows how to inform oneMKL of the existing dependencies between routines using SYCL*-compliant events. This code sample uses pointer-based programming with Unified Shared Memory (USM), allowing individual oneMKL routines to work on submatrices of the original matrices. - -This sample will use the default SYCL device. You can set the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - -This article explains in detail how oneMKL LAPACK routines can be used to solve a system of linear equations with an LU-factored block tridiagonal coefficient matrix: https://www.intel.com/content/www/us/en/docs/onemkl/cookbook/current/slv-sys-lin-eq-lu-factor-blk-tridiag-coeff-mat.html. - -## Key Implementation Details -This sample illustrates several important oneMKL routines: matrix multiplication, triangular solves from BLAS (`gemm`, `trsm`), and LU factorization (`getrf`) from LAPACK, as well as several other utility routines. - -## Using Visual Studio Code* (Optional) -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - - -## Building the Block LU Decomposition Sample - -### On a Linux* System -Run `make` to build and run the factor and solve programs. You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -*Warning*: On Windows, static linking with oneMKL currently takes a very long time due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Block LU Decomposition Sample -### Example of Output -After building, if everything is working correctly, you will see the output from both the `factor` and `solve` programs. Each includes an accuracy check at the end. The example output below shows a successful run with a very small floating-point error. -``` -./factor -Testing the accuracy of LU factorization with pivoting -of randomly generated block tridiagonal matrix -by calculating norm of the residual matrix. -||A - LU||_F/||A||_F = 3.65246e-16 - -./solve -Testing accuracy of solution of linear equations system -with randomly generated block tridiagonal coefficient -matrix by calculating ratios of residuals -to RHS vectors norms. -max_(i=1,...,nrhs){||ax(i)-f(i)||/||f(i)||} = 6.88457e-13 -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/block_lu_decomposition/auxi.cpp b/Libraries/oneMKL/block_lu_decomposition/auxi.cpp deleted file mode 100644 index f4c9846872..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/auxi.cpp +++ /dev/null @@ -1,304 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* Content: -* Auxiliary subroutines for: -* - Computing ratio ||A-L*U||_F/||A||_F of Frobenius norm of the -* residual to the Frobenius norm of the initial matrix. -* - Calculating max_(i=1,...,NRHS){||AX(i)-F(i)||/||F(i)||} of -* ratios of residuals to norms of RHS vectors for a system of -* linear equations with tridiagonal coefficient matrix and -* multiple RHS -* -*/ - -#include -#include -#include -#include -#include -#include "mkl.h" - -/*********************************************************************** -* Definition: -* =========== -* double resid1( int64_t n, int64_t nb, double* dl, double* d, double* du1, double* du2, int64_t* ipiv, double* dlcpy, double* dcpy, double* du1cpy) { -* -* Purpose: -* ======== -* Given LU factorization of block tridiagonal matrix A function RESID1 -* returns ratio ||A-L*U||_F/||A||_F of Frobenius norm of the residual -* to the Frobenius norm of the initial matrix. The ratio provides info -* on how good the factorization is. -* -* Arguments: -* ========== -* N (input) int64_t -* The number of block rows of the matrix A. N > 0. -* -* NB (input) int64_t -* The size of blocks. NB > 0. -* -* DL (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores N-1 subdiagonal blocks (each of size NB by NB) of -* lower triangular factor L. The blocks are stored sequentially -* block by block. -* -* D (input) double array, dimension (NB) * (N*NB) -* The array stores N diagonal blocks (each of size NB by NB) -* of triangular factors L and U. -* -* DU1 (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores N-1 superdiagonal blocks (each of size -* NB by NB) of triangular factor U. -* -* DU2 (input) double array, dimension (NB) * ((N-2)*NB) -* The array stores N-2 blocks of the second superdiagonal of -* triangular factor U. -* -* IPIV (input) int64_t array, dimension (NB) * (N) -* The array stores pivot 'local' row indices. -* -* DLCPY (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores N-1 subdiagonal blocks of initial block -* tridiagonal matrix. -* -* DCPY (input) double array, dimension (NB) * (N*NB) -* The array stores N diagonal blocks of initial block -* tridiagonal matrix. -* -* DU1CPY (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores N-1 superdiagonal blocks of initial block -* tridiagonal matrix. -***********************************************************************/ -double resid1( int64_t n, int64_t nb, double* dl, double* d, double* du1, double* du2, int64_t* ipiv, double* dlcpy, double* dcpy, double* du1cpy) { - - // Matrix accessors - auto D = [=,&d] (int64_t i, int64_t j) -> double& { return d[i + j*nb]; }; - auto DCPY = [=,&dcpy] (int64_t i, int64_t j) -> double& { return dcpy[i + j*nb]; }; - auto DL = [=,&dl] (int64_t i, int64_t j) -> double& { return dl[i + j*nb]; }; - auto DLCPY = [=,&dlcpy] (int64_t i, int64_t j) -> double& { return dlcpy[i + j*nb]; }; - auto DU1 = [=,&du1] (int64_t i, int64_t j) -> double& { return du1[i + j*nb]; }; - auto DU1CPY = [=,&du1cpy] (int64_t i, int64_t j) -> double& { return du1cpy[i + j*nb]; }; - auto DU2 = [=,&du2] (int64_t i, int64_t j) -> double& { return du2[i + j*nb]; }; - auto IPIV = [=,&ipiv] (int64_t i, int64_t j) -> int64_t& { return ipiv[i + j*nb]; }; - - double s = 0.0; - double norm = 0.0; - - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*n, dcpy, nb); - norm = s*s; - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*(n-1), dlcpy, nb); - norm = norm + s*s; - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb*(n-1), du1cpy, nb); - norm = sqrt(norm + s*s); - - const int64_t ldb = 2*nb; - std::vector b(ldb*3*nb); - std::vector b1(ldb*3*nb); - - auto B = [=,&b] (int64_t i, int64_t j) -> double& { return b[i + j*ldb]; }; - auto B1 = [=,&b1](int64_t i, int64_t j) -> double& { return b1[i + j*ldb]; }; - - for(int64_t j = 0; j < 3*nb; j++ ) { - for(int64_t i = 0; i < 2*nb; i++ ) { - B(i,j) = 0.0; - B1(i,j) = 0.0; - } - } - - const int64_t ldl = 2*nb; - std::vector l(ldl*nb); - auto L = [=,&l] (int64_t i, int64_t j) -> double& { return l[i + j*ldl]; }; - - for(int64_t j = 0; j < nb; j++) { - for(int64_t i = 0; i < 2*nb; i++) { - L(i,j) = 0.0; - } - L(j,j) = 1.0; - } - - const int64_t ldu = nb; - std::vector u(ldu*3*nb); - auto U = [=,&u] (int64_t i, int64_t j) -> double& { return u[i + j*ldu]; }; - - for(int64_t j = 0; j < 3*nb; j++) { - for(int64_t i = 0; i < nb; i++) { - U(i,j) = 0.0; - } - } - for(int64_t j = 0; j < nb; j++) { - cblas_dcopy( j+1, &D( 0, (n-1)*nb + j), 1, &U( 0, j), 1); - cblas_dcopy(nb-j-1, &D(j+1, (n-1)*nb + j), 1, &L(j+1, j), 1); - } - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nb, nb, 1.0, l.data(), 2*nb, - u.data(), nb, 1.0, &B1(nb, nb), 2*nb); - for(int64_t j = 0; j < nb; j++) { - cblas_dcopy(j+1, &D( 0, (n-2)*nb + j), 1, &U( 0, j), 1); - cblas_dcopy(nb, &DU1(0, (n-2)*nb + j), 1, &U( 0, nb+j), 1); - cblas_dcopy(nb-j-1,&D(j+1, (n-2)*nb + j), 1, &L(j+1, j), 1); - cblas_dcopy(nb, &DL( 0, (n-2)*nb + j), 1, &L( nb, j), 1); - } - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, 2*nb, 2*nb, nb, 1.0, l.data(), 2*nb, - u.data(), nb, 1.0, b1.data(), 2*nb); - - for (int64_t i = nb -1; i >= 0; i--) { - if(IPIV(i,n-1) != nb+i+1) { - cblas_dswap(2*nb, &B1(nb+i, 0), 2*nb, &B1(IPIV(i,n-1)-1,0), 2*nb); - } - } - for (int64_t i = nb-1; i >= 0; i--) { - if (IPIV(i,n-2) != i+1) { - cblas_dswap(2*nb, &B1(i, 0), 2*nb, &B1(IPIV(i,n-2)-1, 0), 2*nb); - } - } - for(int64_t j = 0; j < nb; j++) { - for(int64_t i = 0; i < nb; i++) { - B1(nb+i, j) = B1(nb+i, j) - DLCPY(i, (n-2)*nb+j); - B1(nb+i, nb+j) = B1(nb+i, nb+j) - DCPY(i, (n-1)*nb+j); - } - } - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb, &B1(nb, 0), 2*nb); - double eps = s*s; - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb, &B1(nb, nb), 2*nb); - eps = eps + s*s; - - for (int64_t k = n-3; k >= 0; k--) { - for(int64_t j = 0; j < nb; j++) { - cblas_dcopy( j+1, &D( 0,k*nb + j), 1, &U(0, j), 1); - cblas_dcopy( nb, &DU1(0,k*nb + j), 1, &U(0, nb+j), 1); - cblas_dcopy( nb, &DU2(0,k*nb + j), 1, &U(0,2*nb+j), 1); - cblas_dcopy(nb-j-1, &D(j+1,k*nb + j), 1, &L(j+1, j), 1); - cblas_dcopy( nb, &DL( 0,k*nb + j), 1, &L(nb, j), 1); - } - - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, 2*nb, 3*nb, nb, 1.0, l.data(), 2*nb, u.data(), nb, 0.0, b.data(), 2*nb); - - for (int64_t j = 0; j < 2*nb; j++) { - for(int64_t i = 0; i < nb; i++) { - B(nb+i, nb+j) = B(nb+i, nb+j) + B1(i, j); - } - } - for (int64_t i = nb-1; i >= 0; i--) { - if (IPIV(i,k) != i+1) { - cblas_dswap(3*nb, &B(i, 0), 2*nb, &B(IPIV(i,k)-1, 0), 2*nb); - } - } - for(int64_t j = 0; j < nb; j++) { - for (int64_t i = 0; i < nb; i++) { - B1(nb+i, j) = B(nb+i, j) - DLCPY(i,(k)*nb+j); - B1(nb+i, nb+j) = B(nb+i, nb+j) - DCPY(i,(k+1)*nb+j); - B1(nb+i,2*nb+j) = B(nb+i,2*nb+j) -DU1CPY(i,(k+1)*nb+j); - } - } - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb, &B(0,2*nb), 2*nb); - eps = eps + s*s; - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb, &B1(nb, 0), 2*nb); - eps = eps + s*s; - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb, &B1(nb, nb), 2*nb); - eps = eps + s*s; - s = LAPACKE_dlange(MKL_COL_MAJOR, 'F', nb, nb, &B1(nb, 2*nb), 2*nb); - eps = eps + s*s; - for ( int64_t j = 0; j < 2*nb; j++) { - cblas_dcopy(nb, &B(0, j), 1, &B1(0, j), 1); - } - } - double resid = sqrt(eps)/norm; - - return resid; -} - -/************************************************************************ -* Definition: -* =========== -* double resid2(int64_t n, int64_t nb, int64_t nrhs, double* dl, double* d, double* du1, double* x, int64_t ldx, double* b, int64_t ldb) - -* Purpose: -* ======== -* Given solution X to a system of linear equations AX=B with tridiagonal -* coefficient matrix A and multiple right hand sides B function RESID2 -* returns max_(i=1,...,NRHS){||AX(i)-B(i)||/||B(i)||}. This quantity -* provides info on how good the solution is. -* -* Arguments: -* ========== -* N (input) int64_t -* The number of block rows of the matrix A. N > 0. -* -* NB (input) int64_t -* The size of blocks. NB > 0. -* -* NRHS (input) int64_t -* The number of right hand sides. NRHS >0. -* -* DL (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores N-1 subdiagonal blocks (each of size NB by NB) of -* the coefficient matrix. The blocks are stored sequentially -* block by block. -* -* D (input) double array, dimension (NB) * (N*NB) -* The array stores N diagonal blocks (each of size NB by NB) -* of the coefficient matrix. The blocks are stored sequentially -* block by block. -* -* DU1 (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores N-1 superdiagonal blocks (each of size NB by NB) -* of the coefficient matrix. The blocks are stored sequentially -* block by block. -* -* X (input) double array, dimension (LDX) * (NRHS). -* The array stores components of the solution to be tested. -* -* LDX (input) int64_t -* The leading dimension of the array X. LDX >= N*NB. -* -* B (input) double array, dimension (LDB) * (NRHS). -* The array stores components of the right hand sides. -* -* LDB (input) int64_t -* The leading dimension of the array B. LDB >= N*NB. -***********************************************************************/ -double resid2(int64_t n, int64_t nb, int64_t nrhs, double* dl, double* d, double* du1, double* x, int64_t ldx, double* b, int64_t ldb) { - - auto DL = [=,&dl] (int64_t i, int64_t j) -> double& { return dl[i + j*nb]; }; - auto D = [=,&d] (int64_t i, int64_t j) -> double& { return d[i + j*nb]; }; - auto DU1 = [=,&du1] (int64_t i, int64_t j) -> double& { return du1[i + j*nb]; }; - auto X = [=,&x] (int64_t i, int64_t j) -> double& { return x[i + j*ldx]; }; - auto B = [=,&b] (int64_t i, int64_t j) -> double& { return b[i + j*ldb]; }; - - // Initializing return value - std::vector norms(nrhs); - - // Compute norms of RHS vectors - for (int64_t i = 0; i < nrhs; i++) { - norms[i] = cblas_dnrm2(nb*n, &B(0,i), 1); - } - - // Computing B(1)-D(1)*X(1)-DU1(1)*X(2) out of loop - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, d, nb, x, ldx, 1.0, b, ldb); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, du1, nb, &X(nb, 0), ldx, 1.0, b, ldb); - - // In the loop computing B(K)-DL(K-1)*X(K-1)-D(K)*X(K)-DU1(K)*X(K+1) - for (int64_t k = 1; k < n-1; k++) { - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &DL(0, (k-1)*nb), nb, &X((k-1)*nb, 0), ldx, 1.0, &B(k*nb, 0), ldb); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &D(0, k*nb), nb, &X( k*nb, 0), ldx, 1.0, &B(k*nb, 0), ldb); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &DU1(0, k*nb), nb, &X((k+1)*nb, 0), ldx, 1.0, &B(k*nb, 0), ldb); - } - - // Computing B(N)-DL(N-1)*X(N-1)-D(N)*X(N) out of loop - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &D(0, (n-1)*nb), nb, &X((n-1)*nb, 0), ldx, 1.0, &B((n-1)*nb, 0), ldb); - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, nb, nrhs, nb, -1.0, &DL(0, (n-2)*nb), nb, &X((n-2)*nb, 0), ldx, 1.0, &B((n-1)*nb, 0), ldb); - - // Compute norms of residual vectors divided by norms of RHS vectors - double res = 0.0; - for (int64_t i = 0; i < nrhs; i++) { - double s = cblas_dnrm2(n*nb, &B(0,i), 1); - res = std::max(res, s/norms[i]); - } - - return res; -} diff --git a/Libraries/oneMKL/block_lu_decomposition/dgeblttrf.cpp b/Libraries/oneMKL/block_lu_decomposition/dgeblttrf.cpp deleted file mode 100644 index df192e24a9..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/dgeblttrf.cpp +++ /dev/null @@ -1,382 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* Function DGEBLTTRF for LU factorization of general block -* tridiagonal matrix; -* Function PTLDGETRF for partial LU factorization of general -* rectangular matrix. -************************************************************************/ -#include -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -int64_t ptldgetrf(sycl::queue queue, int64_t m, int64_t n, int64_t k, double* a, int64_t lda, int64_t* ipiv); - -/************************************************************************ -* Definition: -* =========== -* int64_t dgeblttrf(sycl::queue queue, int64_t n, int64_t nb, double* d, double* dl, double* du1, double* du2, int64_t* ipiv) { -* -* Purpose: -* ======== -* DGEBLTTRF computes LU factorization of general block tridiagonal -* matrix -* (D_1 C_1 ) -* (B_1 D_2 C_2 ) -* ( B_2 D_3 C_3 ) -* ( ......... ) -* ( B_N-2 D_N-1 C_N-1 ) -* ( B_N-1 D_N ) -* using elimination with partial pivoting and row interchanges. -* The factorization has the form A = L*U, where L is a product of -* permutation and unit lower bidiagonal block matrices and U is upper -* triangular with nonzeroes in only the main block diagonal and first -* two block superdiagonals. -* This is a block version of LAPACK DGTTRF subroutine. -* -* Arguments: -* ========== -* QUEUE (input) sycl queue -* The device queue -* -* N (input) int64_t -* The number of block rows of the matrix A. N > 0. -* -* NB (input) int64_t -* The size of blocks. NB > 0. -* -* D (input/output) double array, dimension (NB)*(N*NB) -* On entry, the array stores N diagonal blocks (each of size NB by NB) -* of the matrix to be factored. The blocks are stored -* sequentially: first NB columns of D store block D_1, second NB -* columns store block D_2,...,last NB columns store block D_N. -* On exit, the array stores diagonal blocks of triangular factor L -* and U. Diagonal blocks of lower triangular factor L replace -* respective lower triangles of blocks D_j (1 <= j <= N). -* Diagonal units are not stored. Diagonal blocks of upper -* triangular factor U replace respective upper triangles of -* blocks D_j. -* -* DL (input/output) double array, dimension (NB)*((N-1)*NB) -* On entry, the array stores N-1 subdiagonal blocks (each of size -* NB by NB) of the matrix to be factored. The blocks are stored -* sequentially: first NB columns of DL store block B_1, second -* NB columns store block B_2,...,last NB columns store block -* B_N-1. -* On exit, the array stores subdiagonal blocks of lower triangular -* factor L. -* -* DU1 (input/output) double array, dimension (NB)*((N-1)*NB) -* On entry, the array stores N-1 superdiagonal blocks (each of size -* NB by NB) of the matrix to be factored. The blocks are stored -* sequentially: first NB columns of DU1 store block C_1, second -* NB columns store block C_2,...,last NB columns store block -* C_N-1. -* On exit, the array stores superdiagonal blocks of triangular -* factor U. -* -* DU2 (output) double array, dimension (NB)*((N-2)*NB) -* On exit, the array stores blocks of the second superdiagonal of -* triangular factor U. -* -* IPIV (output) int64_t array, dimension (NB)*(N) -* The pivot 'local' row indices ('local' means indices vary in the -* range 1..2*NB. Global row index is IPIV(I,K) + (K-1)*NB ). -* -* INFO (return) int64_t -* = 0: successful exit -* = -1000 memory buffer could not be allocated -* < 0: if INFO = -i, the i-th argument had an illegal value -* > 0: if INFO = i, U(i,i) is exactly zero. The factorization -* can be not completed. -***********************************************************************/ -int64_t dgeblttrf(sycl::queue queue, int64_t n, int64_t nb, double* d, double* dl, double* du1, double* du2, int64_t* ipiv) { - - // Matrix accessors - auto D = [=,&d] (int64_t i, int64_t j) -> double& { return d[i + j*nb]; }; - auto DL = [=,&dl] (int64_t i, int64_t j) -> double& { return dl[i + j*nb]; }; - auto DU1 = [=,&du1] (int64_t i, int64_t j) -> double& { return du1[i + j*nb]; }; - auto DU2 = [=,&du2] (int64_t i, int64_t j) -> double& { return du2[i + j*nb]; }; - auto IPIV = [=,&ipiv] (int64_t i, int64_t j) -> int64_t& { return ipiv[i + j*nb]; }; - - // Test the input arguments. - int64_t info=0; - if(n <= 0) - info = -1; - else if(nb <= 0) - info = -2; - if(info) - return info; - - sycl::context context = queue.get_context(); - sycl::device device = queue.get_device(); - - // Allocating a contiguous USM array for partial factorizations - const int64_t lda = 2*nb; - double* a = sycl::malloc_shared(lda * 3*nb, device, context); - auto A = [=,&a](int64_t i, int64_t j) -> double& { return a[i + j*lda]; }; - if (!a) { - info = -1000; - goto cleanup; - } - - - for (int64_t k = 0; k < n-2; k++){ - // Form a 2*NB x 3*NB submatrix - // D_K C_K 0 - // B_K D_K+1 C_K+1 - for (int64_t j = 0; j < nb; j++) { - auto event1 = mkl::blas::copy(queue, nb, &D(0,(k)*nb + j), 1, &A(0, j),1); - auto event2 = mkl::blas::copy(queue, nb, &DL(0,(k)*nb + j), 1, &A(nb, j),1); - auto event3 = mkl::blas::copy(queue, nb, &DU1(0,(k)*nb + j), 1, &A(0, nb+j),1); - auto event4 = mkl::blas::copy(queue, nb, &D(0,(k+1)*nb + j), 1, &A(nb, nb+j),1); - auto event5 = mkl::blas::copy(queue, nb, &DU1(0,(k+1)*nb + j), 1, &A(nb,2*nb+j),1); - event1.wait_and_throw(); - event2.wait_and_throw(); - event3.wait_and_throw(); - event4.wait_and_throw(); - event5.wait_and_throw(); - - queue.submit([&](sycl::handler& cgh) { - cgh.parallel_for(sycl::range<1>(nb), [=] (sycl::id<1> it) { - const int64_t i = it[0]; - a[i + (2*nb + j)*lda] = 0.0; - }); - }); - queue.wait(); - - } - - - - // Partial factorization of the submatrix - // (D_K C_K 0 ) (L_K,K ) (U_K,K U_K,K+1, U_K,K+2) - // ( ) = P * ( ) * - // (B_K D_K+1 C_K+1) (L_K+1,K+1) - // - // ( 0 0 0 ) - // + ( ) - // ( 0 D'_K+1 C'_K+1) - info = ptldgetrf(queue, 2*nb, 3*nb, nb, &A(0,0), lda, &IPIV(0,k)); - if (info > 0) { - // INFO is equal to the 'global' index of the element u_ii of the factor - // U which is equal to zero - return info + k*nb; - } - - // Factorization results to be copied back to arrays: - // L_K,K, U_K,K, D'_K+1 -> D - // L_K+1,K -> DL - // U_K,K+1 -> DU1 - // U_K,K+2 -> DU2 - for(int64_t j = 0; j < nb; j++) { - auto event1 = mkl::blas::copy(queue, nb, &A( 0, j), 1, &D(0,k*nb + j), 1); - auto event2 = mkl::blas::copy(queue, nb, &A(nb, j), 1, &DL(0,k*nb + j), 1); - auto event3 = mkl::blas::copy(queue, nb, &A( 0, nb+j), 1, &DU1(0,k*nb + j), 1); - auto event4 = mkl::blas::copy(queue, nb, &A(nb, nb+j), 1, &D(0,(k+1)*nb + j), 1); - auto event5 = mkl::blas::copy(queue, nb, &A( 0,2*nb+j), 1, &DU2(0,k*nb + j), 1); - auto event6 = mkl::blas::copy(queue, nb, &A(nb,2*nb+j), 1, &DU1(0,(k+1)*nb + j), 1); - event1.wait_and_throw(); - event2.wait_and_throw(); - event3.wait_and_throw(); - event4.wait_and_throw(); - event5.wait_and_throw(); - event6.wait_and_throw(); - } - } - - // Out of loop factorization of the last 2*NBx2*NB submatrix - // (D_N-1 C_N-1) (L_N-1,N-1 0) (U_N-1,N-1 U_N-1,N ) - // ( ) = P_N-1* ( ) * ( ) - // (B_N-1 D_N) ( L_N,N-1 L_N,N) ( 0 U_N,N ) - for(int64_t j = 0; j < nb; j++) { - auto event1 = mkl::blas::copy(queue, nb, &D(0, (n-2)*nb + j), 1, &A(0, j), 1); - auto event2 = mkl::blas::copy(queue, nb, &DL(0, (n-2)*nb + j), 1, &A(nb+0, j), 1); - auto event3 = mkl::blas::copy(queue, nb, &DU1(0, (n-2)*nb + j), 1, &A( 0, nb+j), 1); - auto event4 = mkl::blas::copy(queue, nb, &D(0, (n-1)*nb + j), 1, &A(nb+0, nb+j), 1); - event1.wait_and_throw(); - event2.wait_and_throw(); - event3.wait_and_throw(); - event4.wait_and_throw(); - } - - // Pivoting array for the last factorization has 2*NB elements stored in - // two last columns of IPIV - try { - std::int64_t scratchpad_size = mkl::lapack::getrf_scratchpad_size(queue, 2*nb, 2*nb, lda); - double* scratchpad = sycl::malloc_shared(scratchpad_size, device, context); - if (!scratchpad) { - info = -1000; - goto cleanup; - } - auto event1 = mkl::lapack::getrf(queue, 2*nb, 2*nb, &A(0,0), lda, &IPIV(0,n-2), scratchpad, scratchpad_size ); - event1.wait_and_throw(); - sycl::free(scratchpad, context); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to LAPACK API:\ninfo: " << e.info() << std::endl; - if (e.info() > 0) { - // INFO is equal to the 'global' index of the element u_ii of the factor - // U which is equal to zero - info = e.info() + (n-2)*nb; - } - return info; - } - - // Copy the last result back to arrays: - // L_N-1,N-1, L_N,N, U_N-1,N-1, U_N,N -> D - // L_N,N-1 -> DL - // U_N-1,N -> DU1 - for (int64_t j = 0; j < nb; j++) { - auto event1 = mkl::blas::copy(queue, nb, &A(0, j), 1, &D(0, (n-2)*nb + j), 1); - auto event2 = mkl::blas::copy(queue, nb, &A(nb+0, j), 1, &DL(0, (n-2)*nb + j), 1); - auto event3 = mkl::blas::copy(queue, nb, &A(0, nb + j), 1, &DU1(0, (n-2)*nb + j), 1); - auto event4 = mkl::blas::copy(queue, nb, &A(nb+0, nb + j), 1, &D(0, (n-1)*nb + j), 1); - event1.wait_and_throw(); - event2.wait_and_throw(); - event3.wait_and_throw(); - event4.wait_and_throw(); - } - - sycl::free(a, context); - return info; - -cleanup: - sycl::free(a, context); - return info; - -} - - - -/********************************************************************** -* Purpose: -* ======== -* PTLDGETRF computes partial (in a case K= 0. -* -* N (input) int64_t -* The number of columns of the matrix A. N >= 0. -* -* K (input) int64_t -* The number of columns of the matrix A participating in -* factorization. N >= K >= 0 -* -* A (input/output) double array, dimension (LDA)*(N) -* On entry, the M-by-N matrix A to be factored. -* On exit: -* if K >= min(M,N), A is overwritten by details of its LU -* factorization as returned by DGETRF. -* if K < min(M,N), partial factorization A = P * (L * U + A1) -* is performed where P is permutation matrix (pivoting); -* L is M by K lower trapezoidal (with unit diagonal) matrix -* stored in lower MxK trapezoid of A. Diagonal units -* are not stored. -* U is K by N upper trapezoidal matrix stored in upper -* K by N trapezoid of A; -* A1 is (M-K) by (N-K) residual stored in intersection -* of last M-K rows and last N-K columns of A. -* -* LDA (input) int64_t -* The leading dimension of the array A. LDA >= max(1,M). -* -* IPIV (output) int64_t array, dimension (min(M,K)) -* The pivot indices; for 1 <= i <= min(M,K), row i of the -* matrix was interchanged with row IPIV(i). -* -* INFO (return) int64_t -* = 0: successful exit -* < 0: if INFO = -i, the i-th argument had an illegal value -* > 0: if INFO = i, U(i,i) is exactly zero. The factorization -* can be not completed. -***********************************************************************/ -#undef A -#undef D -#undef DL -#undef DU1 -#undef DU2 -#undef IPIV -int64_t ptldgetrf(sycl::queue queue, int64_t m, int64_t n, int64_t k, double* a, int64_t lda, int64_t* ipiv) { - - auto A = [=,&a](int64_t i, int64_t j) -> double& { return a[i + j*lda]; }; - - sycl::context context = queue.get_context(); - sycl::device device = queue.get_device(); - - int64_t info=0; - if(m < 0) - info = -1; - else if(n < 0) - info = -2; - else if( (k > n) || (k <0)) - info = -3; - else if(lda < m) - info = -5; - - if(info) - return info; - - if(k < std::min(m,n)) { - - // LU factorization of first K columns - { - try { - std::int64_t scratchpad_size = mkl::lapack::getrf_scratchpad_size(queue, m, k, lda); - double* scratchpad = sycl::malloc_shared(scratchpad_size, device, context); - if (!scratchpad) { - info = -1000; - return info; - } - auto event1 = mkl::lapack::getrf(queue, m, k, &A(0,0), lda, &ipiv[0], scratchpad, scratchpad_size ); - event1.wait_and_throw(); - sycl::free(scratchpad, context); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to LAPACK API:\ninfo: " << e.info() << std::endl; - if (e.info() > 0) { - info = e.info(); - } - return info; - } - } - for (int64_t i = 0; i < k; i++) { - if(ipiv[i] != i+1) { - // Applying permutations returned by DGETRF to last N-K columns - auto event1 = mkl::blas::swap(queue, n-k, &A(i,k), lda, &A(ipiv[i]-1, k), lda); - event1.wait_and_throw(); - } - } - // Updating A1 - { - auto event1 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::nontrans, mkl::diag::unit, k, n-k, 1.0, &A(0,0), lda, &A(0,k), lda); - auto event2 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, m-k, n-k, k, -1.0, &A(k,0), lda, &A(0,k), lda, 1.0, &A(k,k), lda, {event1}); - event2.wait_and_throw(); - } - } - else { - std::int64_t scratchpad_size = mkl::lapack::getrf_scratchpad_size(queue, m, n, lda); - double* scratchpad = sycl::malloc_shared(scratchpad_size, device, context); - if (!scratchpad) { - info = -1000; - return info; - } - auto event1 = mkl::lapack::getrf(queue, m, n, &A(0,0), lda, &ipiv[0], scratchpad, scratchpad_size ); - event1.wait_and_throw(); - sycl::free(scratchpad, context); - } - - return info; -} diff --git a/Libraries/oneMKL/block_lu_decomposition/dgeblttrs.cpp b/Libraries/oneMKL/block_lu_decomposition/dgeblttrs.cpp deleted file mode 100644 index a10a1b5a1d..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/dgeblttrs.cpp +++ /dev/null @@ -1,176 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* Content: -* Function DGEBLTTRS for solving a system of linear equations -* with LU-factored block tridiagonal coefficient matrix and -* multiple right hand sides. -************************************************************************ -* Definition: -* =========== -* int64_t dgeblttrs(sycl::queue queue, int64_t n, int64_t nb, int64_t nrhs, double* d, double* dl, double* du1, double* du2, int64_t* ipiv, double* f, int64_t ldf) -* -* Purpose: -* ======== -* DGEBLTTRS solves system of linear equations AX = F with general block -* tridiagonal coefficient matrix -* (D_1 C_1 ) -* (B_1 D_2 C_2 ) -* ( B_2 D_3 C_3 ) -* A= ( ......... ) -* ( B_N-2 D_N-1 C_N-1 ) -* ( B_N-1 D_N ) -* -* LU-factored by DGEBLTTRF and multiple RHS F. -* -* Arguments: -* ========== -* QUEUE (input) sycl queue -* The device queue -* -* N (input) int64_t -* The number of block rows of the matrix A. N > 0. -* -* NB (input) int64_t -* The size of blocks. NB > 0. -* -* NRHS (input) int64_t -* The number of right hand sides. NRHS > 0. -* -* D (input) double array, dimension (NB) * (N*NB) -* The array stores N diagonal blocks (each of size NB by NB) -* of triangular factors L and U as they are returned by -* DGEBLTTRF. Diagonal blocks of factors L and U are lower and -* upper triangular respectively, and their diagonal blocks -* with the same index are stored in a block of D with the same -* index occupying respectively lower and upper triangles of a -* block in D. Unit diagonal elements of factor L are not stored. -* -* DL (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores subdiagonal blocks of lower triangular factor L -* as they are returned by DGEBLTTRF. -* -* DU1 (input) double array, dimension (NB) * ((N-1)*NB) -* The array stores superdiagonal blocks of upper triangular factor U -* as they are returned by DGEBLTTRF. -* -* DU2 (input) double array, dimension (NB) * ((N-2)*NB) -* The array stores blocks of the second superdiagonal of upper -* triangular factor U as they are returned by DGEBLTTRF. -* -* IPIV (input) int64_t array, dimension (NB) * (N) -* The array stores pivot 'local' row indices ('local' means indices -* vary in the range 1..2*NB. Global row index is -* IPIV(I,K) + (K-1)*NB ). -* -* F (input/output) double array, dimension (LDF) * (NRHS) -* On entry, the array stores NRHS columns of right hand F of the -* system of linear equations AX = F. -* On exit, the array stores NRHS columns of unknowns of the system -* of linear equations AX = F. -* -* LDF (input) int64_t. LDF >= N*NB -* Leading dimension of the array F -* -* INFO (return) int64_t -* = 0: successful exit -* < 0: if INFO = -i, the i-th argument had an illegal value -***********************************************************************/ -#include -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -int64_t dgeblttrs(sycl::queue queue, int64_t n, int64_t nb, int64_t nrhs, double* d, double* dl, double* du1, double* du2, int64_t* ipiv, double* f, int64_t ldf) { - - // Matrix accessors - auto D = [=,&d] (int64_t i, int64_t j) -> double& { return d[i + j*nb]; }; - auto DL = [=,&dl] (int64_t i, int64_t j) -> double& { return dl[i + j*nb]; }; - auto DU1 = [=,&du1] (int64_t i, int64_t j) -> double& { return du1[i + j*nb]; }; - auto DU2 = [=,&du2] (int64_t i, int64_t j) -> double& { return du2[i + j*nb]; }; - auto IPIV = [=,&ipiv] (int64_t i, int64_t j) -> int64_t& { return ipiv[i + j*nb]; }; - auto F = [=,&f] (int64_t i, int64_t j) -> double& { return f[i + j*ldf]; }; - - // Test the input arguments. - int64_t info = 0; - if (n <= 0) - info = -1; - else if (nb <= 0) - info = -2; - else if (nrhs <= 0) - info = -3; - else if (ldf < n*nb) - info = -10; - - if (info) - return info; - - sycl::context context = queue.get_context(); - sycl::device device = queue.get_device(); - - // Forward substitution - // In the loop compute components Y_K stored in array F - for (int64_t k = 0; k < n-2; k++) { - for (int64_t i = 0; i < nb; i++) { - if (IPIV(i,k) != i+1){ - auto event1 = mkl::blas::swap(queue, nrhs, &F(k*nb+i, 0), ldf, &F(k*nb+IPIV(i,k)-1, 0), ldf); - event1.wait_and_throw(); - } - } - auto event1 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::nontrans, mkl::diag::unit, nb, nrhs, 1.0, &D(0, k*nb), nb, &F(k*nb, 0), ldf); - auto event2 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &DL(0, k*nb), nb, &F(k*nb, 0), ldf, 1.0, &F((k+1)*nb, 0), ldf, {event1}); - event2.wait_and_throw(); - } - - // Apply two last pivots - for (int64_t i = 0; i < nb; i++) { - if (IPIV(i,n-2) != i+1){ - auto event1 = mkl::blas::swap(queue, nrhs, &F((n-2)*nb+i, 0), ldf, &F((n-2)*nb+IPIV(i,n-2)-1, 0), ldf); - event1.wait_and_throw(); - } - } - - for (int64_t i = 0; i < nb; i++) { - if (IPIV(i,n-1) != i+1 + nb){ - auto event1 = mkl::blas::swap(queue, nrhs, &F((n-1)*nb+i, 0), ldf, &F((n-2)*nb+IPIV(i,n-1)-1, 0), ldf); - event1.wait_and_throw(); - } - } - - // Computing components Y_N-1 and Y_N out of loop - { - auto event1 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::nontrans, mkl::diag::unit, nb, nrhs, 1.0, &D(0, (n-2)*nb), nb, &F((n-2)*nb, 0), ldf); - auto event2 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &DL(0, (n-2)*nb), nb, &F((n-2)*nb, 0), ldf, 1.0, &F((n-1)*nb, 0), ldf, {event1}); - auto event3 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::lower, mkl::transpose::nontrans, mkl::diag::unit, nb, nrhs, 1.0, &D(0, (n-1)*nb), nb, &F((n-1)*nb, 0), ldf, {event2}); - event3.wait_and_throw(); - } - - // Backward substitution - // Computing _N out of loop and store in array F - { - auto event1 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::upper, mkl::transpose::nontrans, mkl::diag::nonunit, nb, nrhs, 1.0, &D(0, (n-1)*nb), nb, &F((n-1)*nb, 0), ldf); - event1.wait_and_throw(); - } - - // Computing _N-1 out of loop and store in array F - { - auto event1 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &DU1(0, (n-2)*nb), nb, &F((n-1)*nb, 0), ldf, 1.0, &F((n-2)*nb, 0), ldf); - auto event2 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::upper, mkl::transpose::nontrans, mkl::diag::nonunit, nb, nrhs, 1.0, &D(0, (n-2)*nb), nb, &F((n-2)*nb, 0), ldf, {event1}); - event2.wait_and_throw(); - } - - // In the loop computing components _K stored in array F - for (int64_t k = n-3; k >= 0; k--) { - auto event1 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &DU1(0, k*nb), nb, &F((k+1)*nb, 0), ldf, 1.0, &F(k*nb, 0), ldf); - auto event2 = mkl::blas::gemm(queue, mkl::transpose::nontrans, mkl::transpose::nontrans, nb, nrhs, nb, -1.0, &DU2(0, k*nb), nb, &F((k+2)*nb, 0), ldf, 1.0, &F(k*nb, 0), ldf, {event1}); - auto event3 = mkl::blas::trsm(queue, mkl::side::left, mkl::uplo::upper, mkl::transpose::nontrans, mkl::diag::nonunit, nb, nrhs, 1.0, &D(0, k*nb), nb, &F(k*nb, 0), ldf, {event2}); - event3.wait_and_throw(); - } - - return info; -} diff --git a/Libraries/oneMKL/block_lu_decomposition/factor.cpp b/Libraries/oneMKL/block_lu_decomposition/factor.cpp deleted file mode 100644 index 1ef6106b80..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/factor.cpp +++ /dev/null @@ -1,136 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* Example of LU factorization of general block tridiagonal matrix -************************************************************************ -* Purpose: -* ======== -* Testing LU factorization of block tridiagonal matrix -* (D_1 C_1 ) -* (B_1 D_2 C_2 ) -* ( B_2 D_3 C_3 ) -* ( ......... ) -* ( B_N-2 D_N-1 C_N-1 ) -* ( B_N-1 D_N ) -* provided by function dgeblttrf by calculating Frobenius norm of the -* residual ||A-L*U||. Computation of the residual and its Frobenius norm -* is done by function resid1 (for source see file auxi.cpp). -* Input block tridiagonal matrix A is randomly generated. -*/ - -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -int64_t dgeblttrf(sycl::queue queue, int64_t n, int64_t nb, double* d, double* dl, double* du1, double* du2, int64_t* ipiv); -double resid1( int64_t n, int64_t nb, double* dl, double* d, double* du1, double* du2, int64_t* ipiv, double* dlcpy, double* dcpy, double* du1cpy); - -template -using allocator_t = sycl::usm_allocator; - -int main(){ - - if (sizeof(MKL_INT) != sizeof(int64_t)) { - std::cerr << "MKL_INT not 64bit" << std::endl; - return -1; - } - - int64_t n = 200; - int64_t nb = 20; - - int64_t info = 0; - - // Asynchronous error handler - auto error_handler = [&] (sycl::exception_list exceptions) { - for (auto const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during asynchronous call - info = e.info(); - std::cout << "Unexpected exception caught during asynchronous LAPACK operation:\ninfo: " << e.info() << std::endl; - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during asynchronous call - std::cout << "Unexpected exception caught during asynchronous operation:\n" << e.what() << std::endl; - info = -1; - } - } - }; - - sycl::device device{sycl::default_selector_v}; - sycl::queue queue(device, error_handler); - sycl::context context = queue.get_context(); - - if (device.is_gpu() && device.get_platform().get_backend() != sycl::backend::ext_oneapi_level_zero) { - std::cerr << "This sample requires Level Zero when running on GPUs." << std::endl; - std::cerr << "Please check your system configuration." << std::endl; - return 0; - } - - if (device.get_info().empty()) { - std::cerr << "This sample uses double precision, which is not supported" << std::endl; - std::cerr << "by the selected device. Quitting." << std::endl; - return 0; - } - - allocator_t allocator_d(context, device); - allocator_t allocator_i(context, device); - - std::vector> d(nb* n*nb, allocator_d); - std::vector> dl(nb* (n-1)*nb, allocator_d); - std::vector> du1(nb* (n-1)*nb, allocator_d); - std::vector> du2(nb* (n-2)*nb, allocator_d); - - std::vector> dcpy(nb* n*nb, allocator_d); - std::vector> dlcpy(nb* (n-1)*nb, allocator_d); - std::vector> du1cpy(nb* (n-1)*nb, allocator_d); - - std::vector> ipiv(nb* n, allocator_i); - std::vector iseed = {9, 41, 11, 3}; - - - std::cout << "Testing accuracy of LU factorization with pivoting" << std::endl; - std::cout << "of randomly generated block tridiagonal matrix " << std::endl; - std::cout << "by calculating norm of the residual matrix." << std::endl; - - // Initializing arrays randomly - LAPACKE_dlarnv(2, iseed.data(), n*nb*nb, d.data()); - LAPACKE_dlarnv(2, iseed.data(), (n-1)*nb*nb, dl.data()); - LAPACKE_dlarnv(2, iseed.data(), (n-1)*nb*nb, du1.data()); - - // Copying arrays for testing purposes - cblas_dcopy(n*nb*nb, d.data(), 1, dcpy.data(), 1); - cblas_dcopy((n-1)*nb*nb, dl.data(), 1, dlcpy.data(), 1); - cblas_dcopy((n-1)*nb*nb, du1.data(), 1, du1cpy.data(), 1); - - // Factoring the matrix - try { - info = dgeblttrf(queue, n, nb, d.data(), dl.data(), du1.data(), du2.data(), ipiv.data()); - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during synchronous call - std::cout << "Unexpected exception caught during synchronous call to SYCL API:\n" << e.what() << std::endl; - info = -1; - } - // Check the exit INFO for success - if(info){ - std::cout << "DGEBLTTRF returned nonzero INFOi = " << info << std::endl; - return 1; - } - - // Computing the ratio ||A - LU||_F/||A||_F - double eps = resid1(n, nb, dl.data(), d.data(), du1.data(), du2.data(), ipiv.data(), dlcpy.data(), dcpy.data(), du1cpy.data()); - std::cout << "||A - LU||_F/||A||_F = " << eps << std::endl; - - return 0; -} diff --git a/Libraries/oneMKL/block_lu_decomposition/makefile b/Libraries/oneMKL/block_lu_decomposition/makefile deleted file mode 100644 index b566e6496e..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Makefile for NMAKE - -all: factor.exe solve.exe - .\factor.exe - .\solve.exe - -DPCPP_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl="blas,lapack" /DMKL_ILP64 /EHsc -fsycl-device-code-split=per_kernel OpenCL.lib - -factor.exe: factor.cpp dgeblttrf.cpp auxi.cpp - icx-cl -fsycl factor.cpp dgeblttrf.cpp auxi.cpp /Fefactor.exe $(DPCPP_OPTS) - -solve.exe: solve.cpp dgeblttrf.cpp dgeblttrs.cpp auxi.cpp - icx-cl -fsycl solve.cpp dgeblttrf.cpp dgeblttrs.cpp auxi.cpp /Fesolve.exe $(DPCPP_OPTS) - -clean: - del /q factor.exe factor.exp factor.lib solve.exe solve.exp solve.lib diff --git a/Libraries/oneMKL/block_lu_decomposition/sample.json b/Libraries/oneMKL/block_lu_decomposition/sample.json deleted file mode 100644 index 7834a2b07e..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "3EC851D1-056A-4973-A2F7-9FC7EFEDA785", - "name": "Block LU Decomposition", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Block LU Decomposition using Intel® oneMKL BLAS and LAPACK", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "block_lu_decomposition", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "block_lu_decomposition", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/block_lu_decomposition/solve.cpp b/Libraries/oneMKL/block_lu_decomposition/solve.cpp deleted file mode 100644 index 2c9f5fb29e..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/solve.cpp +++ /dev/null @@ -1,154 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* Example of solving a system of linear equations with general -* block tridiagonal coefficient matrix -************************************************************************ -* Purpose: -* ======== -* Testing solution of a linear system of equations with general block -* tridiagonal matrix of coefficients -* D(1)*X(1) + C(1)*X(2) = F(1) -* B(1)*X(1) + D(2)*X(2) + C(2)*X(3) = F(2) -* B(2)*X(2) + D(3)*X(3) + C(3)*X(4) = F(3) -* ... -* B(N-2)*X(N-2) + D(N-1)*X(N-1) + C(N-1)*X(N) = F(N-1) -* B(N-1)*X(N-1) + D(N)*X(N) = F(N) -* Here D(J),B(J),C(J) are NB by NB matrices - block matrix coefficients -* X(J),F(J) are NB by NRHS-matrices - unknowns and RHS components -* -* Solving is done via LU factorization of the coefficient matrix -* (call DGEBLTTRF) followed by call DGEBLTTRS to solve a system of -* equations with coefficient matrix factored by DGEBLTTRF. -* -* Coefficients and right hand sides are randomly generated. -* -* Testing is done via calculating -* max{||F(1)-D(1)*X(1)-C(1)*X(2)||, -* ||F(2)-B(1)*X(1)-D(1)*X(1)-C(1)*X(2)||, -* ... -* ||F(N)-B(N-1)*X(N-1)-D(N)*X(N)||} -* -* ||.|| denotes Frobenius norm of a respective matrix -*/ -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -int64_t dgeblttrf(sycl::queue, int64_t n, int64_t nb, double* d, double* dl, double* du1, double* du2, int64_t* ipiv); -int64_t dgeblttrs(sycl::queue, int64_t n, int64_t nb, int64_t nrhs, double* d, double* dl, double* du1, double* du2, int64_t* ipiv, double* f, int64_t ldf); -double resid2(int64_t n, int64_t nb, int64_t nrhs, double* dl, double* d, double* du1, double* x, int64_t ldx, double* b, int64_t ldb); - -template -using allocator_t = sycl::usm_allocator; - -int main() { - if (sizeof(MKL_INT) != sizeof(int64_t)) { - std::cerr << "MKL_INT not 64bit" << std::endl; - return -1; - } - - int64_t n = 200; - int64_t nb = 20; - int64_t nrhs = 10; - int64_t ldf = nb*n; - - int64_t info = 0; - - // Asynchronous error handler - auto error_handler = [&] (sycl::exception_list exceptions) { - for (auto const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch(mkl::lapack::exception const& e) { - // Handle LAPACK related exceptions happened during asynchronous call - info = e.info(); - std::cout << "Unexpected exception caught during asynchronous LAPACK operation:\ninfo: " << e.info() << std::endl; - } catch(sycl::exception const& e) { - // Handle not LAPACK related exceptions happened during asynchronous call - std::cout << "Unexpected exception caught during asynchronous operation:\n" << e.what() << std::endl; - info = -1; - } - } - }; - - sycl::device device{sycl::default_selector_v}; - sycl::queue queue(device, error_handler); - sycl::context context = queue.get_context(); - - if (device.is_gpu() && device.get_platform().get_backend() != sycl::backend::ext_oneapi_level_zero) { - std::cerr << "This sample requires Level Zero when running on GPUs." << std::endl; - std::cerr << "Please check your system configuration." << std::endl; - return 0; - } - - if (device.get_info().empty()) { - std::cerr << "This sample uses double precision, which is not supported" << std::endl; - std::cerr << "by the selected device. Quitting." << std::endl; - return 0; - } - - allocator_t allocator_d(context, device); - allocator_t allocator_i(context, device); - - std::vector> d(nb * n*nb, allocator_d); - std::vector> dl(nb * (n-1)*nb, allocator_d); - std::vector> du1(nb * (n-1)*nb, allocator_d); - std::vector> du2(nb * (n-2)*nb, allocator_d); - std::vector> f(ldf * nrhs, allocator_d); - std::vector> dcpy(nb * n*nb, allocator_d); - std::vector> dlcpy(nb * (n-1)*nb, allocator_d); - std::vector> du1cpy(nb * (n-1)*nb, allocator_d); - std::vector> fcpy(ldf * nrhs, allocator_d); - - std::vector> ipiv(nb * n, allocator_i); - std::vector iseed = {1, 4, 23, 77}; - - // Initializing arrays randomly - LAPACKE_dlarnv(2, reinterpret_cast(iseed.data()), n*nb*nb, d.data()); - LAPACKE_dlarnv(2, reinterpret_cast(iseed.data()), (n-1)*nb*nb, dl.data()); - LAPACKE_dlarnv(2, reinterpret_cast(iseed.data()), (n-1)*nb*nb, du1.data()); - LAPACKE_dlarnv(2, reinterpret_cast(iseed.data()), n*nb*nrhs, f.data()); - - // Copying arrays for testing purposes - cblas_dcopy(n*nb*nb, d.data(), 1, dcpy.data(), 1); - cblas_dcopy((n-1)*nb*nb, dl.data(), 1, dlcpy.data(), 1); - cblas_dcopy((n-1)*nb*nb, du1.data(), 1, du1cpy.data(), 1); - cblas_dcopy(n*nb*nrhs, f.data(), 1, fcpy.data(), 1); - - std::cout << "Testing accuracy of solution of linear equations system" << std::endl; - std::cout << "with randomly generated block tridiagonal coefficient" << std::endl; - std::cout << "matrix by calculating ratios of residuals" << std::endl; - std::cout << "to RHS vectors' norms." << std::endl; - - // LU factorization of the coefficient matrix - info = dgeblttrf(queue, n, nb, d.data(), dl.data(), du1.data(), du2.data(), ipiv.data()); - if (info) { - std::cout << "DGEBLTTRF returned nonzero INFO = " << info << std::endl; - return 1; - } - - // Solving the system of equations using factorized coefficient matrix - info = dgeblttrs(queue, n, nb, nrhs, d.data(), dl.data(), du1.data(), du2.data(), ipiv.data(), f.data(), ldf); - if (info) { - std::cout << -info << "-th parameter in call of dgeblttrs has illegal value" << std::endl; - return 1; - } else { - // computing the residual - double eps = resid2(n, nb, nrhs, dlcpy.data(), dcpy.data(), du1cpy.data(), f.data(), ldf, fcpy.data(), ldf); - std::cout << "max_(i=1,...,nrhs){||ax(i)-f(i)||/||f(i)||} = " << eps << std::endl; - } - - return 0; -} diff --git a/Libraries/oneMKL/block_lu_decomposition/third-party-programs.txt b/Libraries/oneMKL/block_lu_decomposition/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/block_lu_decomposition/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/computed_tomography/GNUmakefile b/Libraries/oneMKL/computed_tomography/GNUmakefile deleted file mode 100644 index 5f03a668a7..0000000000 --- a/Libraries/oneMKL/computed_tomography/GNUmakefile +++ /dev/null @@ -1,20 +0,0 @@ -#Makefile for GNU make - -default: run - -all: run - -run: computed_tomography - ./computed_tomography - -MKL_COPTS = -qmkl -qmkl-sycl-impl=dft - -DPCPP_OPTS = $(MKL_COPTS) -fsycl-device-code-split=per_kernel - -computed_tomography: computed_tomography.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -clean: - -rm -f computed_tomography radon.bmp restored.bmp errors.bmp - -.PHONY: clean run all diff --git a/Libraries/oneMKL/computed_tomography/License.txt b/Libraries/oneMKL/computed_tomography/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/computed_tomography/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/computed_tomography/README.md b/Libraries/oneMKL/computed_tomography/README.md deleted file mode 100644 index b323ce35a1..0000000000 --- a/Libraries/oneMKL/computed_tomography/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# `Computed Tomography Reconstruction` Sample - -Computed Tomography shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) DFT functionality to simulate computed tomography (CT) imaging. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use oneMKL Discrete Fourier Transform (DFT) functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -Computed Tomography uses oneMKL discrete Fourier transform (DFT) routines to transform simulated raw CT data (as collected by a CT scanner) into a reconstructed image of the scanned object. - -In computed tomography, the raw imaging data is a set of line integrals over the actual object, also known as its _Radon transform_. From this data, the original image must be recovered by approximately inverting the Radon transform. This sample uses Fourier reconstruction for inverting the Radon transform of a user-provided input image. Using batched 1D real DFT of Radon transform data points, samples of the input image's Fourier spectrum may be estimated on a polar grid. After interpolating the latter onto a Cartesian grid, an inverse 2D real DFT produces a fair reproduction of the original image. - -This sample performs its computations on the default SYCL device. You can set the `ONEAPI_DEVICE_SELECTOR` environment variable to `*:cpu` or `*:gpu` to select the device to use. - -## Key Implementation Details - -To use oneMKL DFT routines, the sample creates double-precision real DFT descriptor objects and calls the `commit` member function with a `sycl::queue` object to define the device and context. The `compute_*` routines are then called to perform the actual computation with the appropriate descriptor object and input data. - -## Using Visual Studio Code* (Optional) -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - - -## Building the Computed Tomography Reconstruction Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build and run the sample. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -> **Warning**: On Windows, static linking with oneMKL currently takes a very long time due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Computed Tomography Reconstruction Sample - -### Example of Output -If everything is working correctly, the example program will start with the 400x400 example image `input.bmp` then create simulated CT data from it (stored as `radon.bmp`). It will then reconstruct the original image in grayscale and store it as `restored.bmp`. - -``` -./computed_tomography -Reading original image from input.bmp -Generating Radon transform data from input.bmp -Saving Radon transform data in radon.bmp -Reconstructing image from the Radon projection data - Step 1 - Batch of 400 real 1D in-place forward DFTs of length 400 - Step 2 - Interpolating spectrum from polar to cartesian grid - Step 3 - In-place backward real 2D DFT of size 400x400 -Saving restored image in restored.bmp -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/computed_tomography/computed_tomography.cpp b/Libraries/oneMKL/computed_tomography/computed_tomography.cpp deleted file mode 100644 index 9c20e3e26c..0000000000 --- a/Libraries/oneMKL/computed_tomography/computed_tomography.cpp +++ /dev/null @@ -1,944 +0,0 @@ -//===================================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ==================================================================== - -/* -* Content: -* Reconstruct the original image from the Computed Tomography (CT) -* data using oneMKL DPC++ Discrete Fourier Transforms (DFTs). -************************************************************************ -*/ -#include -#include -#include -#include -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -#if !defined(M_PI) -#define M_PI 3.14159265358979323846 -#endif - -namespace dft_ns = oneapi::mkl::dft; -using real_descriptor_t = - dft_ns::descriptor; -using complex_t = std::complex; -// This sample takes the side length of the input image's pixels as unit length -constexpr double in_pix_len = 1.0; - -// A transparent matrix structure accounting for minimal padding as required for -// - either a batch of h real 1D in-place DFTs of length w; -// - or one real 2D in-place DFT of lengths {h, w}. -// For such operations (real in-place DFTs), data padding is required to store -// all the backward domain's elements. -struct padded_matrix { - sycl::queue queue; - double *data; - int h, w; - padded_matrix(sycl::queue &main_queue) : - queue{main_queue}, data{nullptr}, h(0), w(0) {} - padded_matrix(const padded_matrix&) = delete; - padded_matrix& operator=(const padded_matrix&) = delete; - void deallocate() { - if (data) - sycl::free(data, queue); - data = nullptr; - h = w = 0; - } - inline int complex_padded_width() const { - return (w / 2 + 1); - } - inline int real_padded_width() const { - return 2 * complex_padded_width(); - } - void allocate(int _h, int _w) { - deallocate(); - h = _h; - w = _w; - data = sycl::malloc_shared(h * real_padded_width(), queue); - } - ~padded_matrix() { - deallocate(); - } -}; - -// Routine terminating the application and reporting ad-hoc information. -void die(const std::string& err) { - std::cerr << "Fatal error: " << err << std::endl; - std::exit(EXIT_FAILURE); -} - -double -bmp_read(padded_matrix&, const std::string&); - -void -bmp_write(const std::string&, const padded_matrix&, const int*, const int*); - -sycl::event -acquire_radon(padded_matrix&, double, const padded_matrix&); - -void -reconstruction_from_radon(padded_matrix&, padded_matrix&, double, sycl::event&); - -double -compute_errors(padded_matrix&, double, const padded_matrix&, const padded_matrix&); - -int main(int argc, char **argv) { - constexpr int default_p = 400; - constexpr int default_q = 400; - constexpr double default_S_to_D = 1.0; - constexpr std::string_view default_original_bmpname = "input.bmp"; - constexpr std::string_view default_radon_bmpname = "radon.bmp"; - constexpr std::string_view default_restored_bmpname = "restored.bmp"; - constexpr std::string_view default_errors_bmpname = "errors.bmp"; - constexpr int default_crop = 1; - constexpr double arbitrary_error_threshold = 0.1; - /*----------------------- USAGE INFO START --------------------------------*/ - const std::string usage_info = -"\n\ - Usage:\n\ - ======\n\ - " + std::string(argv[0]) + " p q in radon_out restored_out S_to_D err_out crop\n\ - Inputs:\n\ - -------\n\ - p - number of projection directions considered for the Radon\n\ - transform (number of angles spanning a range of M_PI).\n\ - p must be a strictly positive integer (default value is " + - std::to_string(default_p) + ").\n\ - q - number of samples of the Radon transform for every\n\ - projection direction.\n\ - q must be a strictly positive integer (default value is " + - std::to_string(default_q) + ").\n\ - in - name of the input image used to generate Radon transform data.\n\ - The file must be a 24-bit uncompressed bitmap file.\n\ - \"" + std::string(default_original_bmpname) + "\" is considered by default.\n\ - S_to_D - ratio of the scanning width used for sampling the Radon\n\ - transform (for any projection direction) to the diagonal of\n\ - the input image.\n\ - S_to_D must be a floating-point value larger than or equal\n\ - to 1.0 (default value is " + - std::to_string(default_S_to_D) + ").\n\ - crop - integer flag indicating whether to crop the generated bitmap\n\ - output images to their range of relevance or not. Images are\n\ - (resp. are not) cropped if the value is 1 (resp. 0).\n\ - The supported values are 0 and 1 (default value is " - + std::to_string(default_crop) + ").\n\ - Outputs:\n\ - --------\n\ - radon_out - name of a 24-bit uncompressed bitmap image file storing a\n\ - gray-scaled image representing the generated Radon\n\ - transform data points.\n\ - \"" + std::string(default_radon_bmpname) + "\" is used by default.\n\ - restored_out - name of a 24-bit uncompressed bitmap image file storing a\n\ - gray-scaled image representing the image reconstructed\n\ - from the Radon transform data points.\n\ - \"" + std::string(default_restored_bmpname) + "\" is used by default.\n\ - err_out - name of a 24-bit uncompressed bitmap image file storing a\n\ - gray-scaled image representing the pixel-wise error in the\n\ - restored_out file. This file is created only if the mean\n\ - global error is found to exceed " - + std::to_string(100.0*arbitrary_error_threshold) + - "% of the maximum\n\ - gray-scale value in the original image.\n\ - \"" + std::string(default_errors_bmpname) + "\" is considered by default.\n\ -"; - /*------------------------ USAGE INFO END --------------------------------*/ - if (argc > 1 && - (std::strcmp(argv[1], "-h") == 0 || std::strcmp(argv[1], "-H") == 0)) { - std::cout << usage_info << std::endl; - return EXIT_SUCCESS; - } - const int p = argc > 1 ? std::atoi(argv[1]) : - default_p; - const int q = argc > 2 ? std::atoi(argv[2]) : - default_q; - const std::string original_bmpname = argc > 3 ? argv[3] : - std::string(default_original_bmpname); - const std::string radon_bmpname = argc > 4 ? argv[4] : - std::string(default_radon_bmpname); - const std::string restored_bmpname = argc > 5 ? argv[5] : - std::string(default_restored_bmpname); - const double S_to_D = argc > 6 ? std::atof(argv[6]) : - default_S_to_D; - const std::string errors_bmpname = argc > 7 ? argv[7] : - std::string(default_errors_bmpname); - const int crop = argc > 8 ? std::atoi(argv[8]) : - default_crop; - // validate numerical input arguments - if (argc > 9 || p <= 0 || q <= 0 || S_to_D < 1.0 || crop < 0 || crop > 1) { - die("invalid usage.\n" + usage_info); - } - // range of pixel indices to consider when exporting an image. - int i_range[2] = {std::numeric_limits::lowest(), - std::numeric_limits::max()}; - int j_range[2] = {std::numeric_limits::lowest(), - std::numeric_limits::max()}; - - // Create execution queue. - sycl::queue main_queue; - try { - // This sample requires double-precision floating-point arithmetic: - main_queue = sycl::queue(sycl::aspect_selector({sycl::aspect::fp64})); - } catch (sycl::exception &e) { - std::cerr << "Could not find any device with double precision support." - << "Exiting." << std::endl; - return 0; - } - // read input image and convert it to gray-scale values - std::cout << "Reading original image from " << original_bmpname << std::endl; - padded_matrix original(main_queue); - const double max_input_value = bmp_read(original, original_bmpname); - // diagonal D of original image - const double ww = original.w*in_pix_len; - const double hh = original.h*in_pix_len; - const double D = std::hypot(hh, ww); - // scanning width S - const double S = S_to_D * D; - // Compute samples of the radon transform - padded_matrix radon_image(main_queue); - radon_image.allocate(p, q); - if (!radon_image.data) - die("cannot allocate memory for Radon projection"); - std::cout << "Generating Radon transform data from " - << original_bmpname << std::endl; - auto radon_ev = acquire_radon(radon_image, S, original); - if (crop == 1) { - // values of radon_image.data[i*radon_image.real_padded_width() + j] are - // expected to be 0.0 if |(-1.0 + (2.0*j + 1.0)/q)*S_to_D| > 1 - i_range[0] = 0; - i_range[1] = radon_image.h; - j_range[0] = - static_cast(std::ceil(0.5*((1.0 - 1.0/S_to_D)*q - 1.0))); - j_range[1] = - static_cast(std::ceil(0.5*((1.0 + 1.0/S_to_D)*q - 1.0))); - } - std::cout << "Saving Radon transform data in " - << radon_bmpname << std::endl; - radon_ev.wait(); // make sure it completes before exporting data - bmp_write(radon_bmpname, radon_image, i_range, j_range); - // reconstruct image from its radon transform samples - padded_matrix reconstruction(main_queue); - reconstruction_from_radon(reconstruction, radon_image, S, radon_ev); - if (crop == 1) { - // values of reconstruction.data[i*reconstruction.real_padded_width() + j] - // are out of the relevant range of comparison if - // |(i - q/2)*S/q| - 0.5*S/q > 0.5*hh - // or - // |(j - q/2)*S/q| - 0.5*S/q > 0.5*ww - i_range[0] = static_cast(std::ceil(-0.5*hh*q/S + q/2 - 0.5)); - i_range[1] = static_cast(std::ceil(+0.5*hh*q/S + q/2 + 0.5)); - j_range[0] = static_cast(std::ceil(-0.5*ww*q/S + q/2 - 0.5)); - j_range[1] = static_cast(std::ceil(+0.5*ww*q/S + q/2 + 0.5)); - } - std::cout << "Saving restored image in " << restored_bmpname << std::endl; - bmp_write(restored_bmpname, reconstruction, i_range, j_range); - // evaluate the mean error, pixel by pixel in the reconstructed image - padded_matrix errors(main_queue); - const double mean_error = compute_errors(errors, S, original, reconstruction); - std::cout << "The normalized mean difference between the reconstructed " - << "image and the original image is " << 100*mean_error << "%." - << std::endl; - if (mean_error / max_input_value > arbitrary_error_threshold) { - std::cerr << "The normalized mean difference exceeds the " - << "(arbitrarily-chosen) threshold of " - << 100.0*arbitrary_error_threshold - << "% of the original image's maximum gray-scale value." - << std::endl; - if (std::fabs(p * S_to_D - q) > 0.2*std::max(p*S_to_D, double(q))) { - std::cerr << "It is recommended to use values of p and q such that " - << "p*S_to_D and q are commensurate." << std::endl; - } - else if (S / q > 2.0*in_pix_len) { - std::cerr << "Consider increasing q (to " - << std::ceil(S/(2.0*in_pix_len)) << " or more) " - << "to alleviate blurring in the reconstructed image." - << std::endl; - } - else { - std::cerr << "Consider increasing S_to_D and q proportionally to " - << "one another to reduce interpolation errors." - << std::endl; - } - std::cerr << "Saving local errors in " << errors_bmpname << "." - << std::endl; - // same relevant pixel indices for errors as for reconstruction - bmp_write(errors_bmpname, errors, i_range, j_range); - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} - -// Simplified BMP structure. -// See http://msdn.microsoft.com/en-us/library/dd183392(v=vs.85).aspx -#pragma pack(push, 1) -struct bmp_header { - char bf_type[2]; - unsigned int bf_size; - unsigned int bf_reserved; - unsigned int bf_off_bits; - - unsigned int bi_size; - unsigned int bi_width; - unsigned int bi_height; - unsigned short bi_planes; - unsigned short bi_bit_count; - unsigned int bi_compression; - unsigned int bi_size_image; - unsigned int bi_x_pels_per_meter; - unsigned int bi_y_pels_per_meter; - unsigned int bi_clr_used; - unsigned int bi_clr_important; -}; -#pragma pack(pop) -struct pixel { - unsigned char b, g, r; -}; -// Routine reading a 24-bit uncompressed bitmap image file and converting it to -// a gray-scale padded_matrix (array of doubles in [0, 1], 0 is white, 1 is -// black). The maximum such gray-scale value is returned. -double bmp_read(padded_matrix& image, const std::string& fname) { - std::fstream fp; - fp.open(fname, std::fstream::in | std::fstream::binary); - if (fp.fail()) - die("cannot open the file " + fname); - - bmp_header header; - - fp.read((char *)(&header), sizeof(header)); - if (header.bi_bit_count != 24) { - fp.close(); - die("not a 24-bit image in " + fname); - } - if (header.bi_compression) { - fp.close(); - die(fname + " is compressed bmp"); - } - if (header.bi_height <= 0 || header.bi_width <= 0) { - fp.close(); - die("image " + fname + " has zero size"); - } - if (header.bi_height > 65536 || header.bi_width > 65536) { - fp.close(); - die("image " + fname + " is too large"); - } - - image.allocate(header.bi_height, header.bi_width); - if (!image.data) - die("no memory to read " + fname); - - fp.seekg(sizeof(header), std::ios_base::beg); - pixel pix; - double max_gray_scale = std::numeric_limits::lowest(); - for (int i = 0; i < image.h; ++i) { - for (int j = 0; j < image.w; ++j) { - fp.read((char *)(&pix), 3); - double gray_scale = (255.0 - (pix.r + pix.g + pix.b) / 3.0) / 255.0; - image.data[i * image.real_padded_width() + j] = gray_scale; - max_gray_scale = std::max(max_gray_scale, gray_scale); - } - // rows are rounded up to a multiple of 4 bytes in BMP format - fp.seekg((4 - (3 * image.w) % 4) % 4, std::ios_base::cur); - } - - if (!fp) - die("error reading " + fname); - - fp.close(); - return max_gray_scale; -} -// Routine exporting the values image.data[i*image.real_padded_width() + j] of -// a padded_matrix "image" for indices (i, j) such that -// max(min_max_i[0], 0) <= i < min(min_max_i[1], image.h) -// max(min_max_j[0], 0) <= j < min(min_max_j[1], image.w) -// as a gray-scale 24-bit uncompressed bitmap image file. -// For every such relevant entry v of the matrix, a gray scale value -// proportional to max(v, 0.0) is calculated (maximizing contrast) and the -// corresponding pixel's color code is generated. In other words, negative -// values are ignored (considered white) by this routine. -// Note: while negative values may be found in the reconstructed image, they -// may be considered artifacts (e.g., due to Gibbs phenomenon) and/or local -// errors of the reconstruction procedure (e.g., due to the rudimentary spectrum -// interpolation). -void bmp_write(const std::string& fname, const padded_matrix& image, - const int min_max_i[2], const int min_max_j[2]) { - const int min_i = std::max(min_max_i[0], 0); - const int max_i = std::min(min_max_i[1], image.h); - const int min_j = std::max(min_max_j[0], 0); - const int max_j = std::min(min_max_j[1], image.w); - if (max_i <= min_i || max_j <= min_j) - die("invalid range of pixel indices for bmp_write to export"); - - unsigned int sizeof_line = ((max_j - min_j) * 3 + 3) / 4 * 4; - unsigned int sizeof_image = (max_i - min_i) * sizeof_line; - - bmp_header header = {{'B', 'M'}, - unsigned(sizeof(header) + sizeof_image), - 0, - sizeof(header), - sizeof(header) - offsetof(bmp_header, bi_size), - unsigned(max_j - min_j), - unsigned(max_i - min_i), - 1, - 24, - 0, - sizeof_image, - 6000, - 6000, - 0, - 0}; - - std::fstream fp; - fp.open(fname, std::fstream::out | std::fstream::binary); - if (fp.fail()) - die("failed to save the image, cannot open file " + fname); - - fp.write((char *)(&header), sizeof(header)); - double v_max = std::numeric_limits::lowest(); - for (int i = min_i; i < max_i; ++i) - for (int j = min_j; j < max_j; ++j) - v_max = std::max(image.data[i * image.real_padded_width() + j], v_max); - - if (v_max <= 0.0) { - fp.close(); - die("inconsistent data range to consider for exporting " + fname); - } - pixel pix; - for (int i = min_i; i < max_i; ++i) { - for (int j = min_j; j < max_j; ++j) { - const double gray = - std::max(image.data[i * image.real_padded_width() + j], 0.0)/v_max; - pix.b = pix.g = pix.r = - static_cast(std::round(255.0*(1.0 - gray))); - fp.write((char *)(&pix), 3); - } - // rows are rounded up to a multiple of 4 bytes in BMP format - for (int j = 3 * (max_j - min_j); j % 4; ++j) - fp.put(0); - } - fp.close(); -} - -// For a given 2D function f(y, x), the radon transform of f is defined as -// radon[f](theta, v) := integral of f along line L -// where L is the set of points (y, x) such that -// x*cos(theta) + y*sin(theta) = v -// in a given orthonormal frame. -// Let p = radon_projection.h, q = radon_projection.w, and -// radon_ldw = radon_projection.real_padded_width(). For all integers i in -// [0, p-1] and j in [0, q-1], this routine sets -// radon_projection.data[i*radon_ldw + j] = radon[f_input](theta(i), v(j)) -// where -// theta(i) = -0.5*M_PI + i*M_PI/p, -// v(j) = (-1.0 + (2.0*j + 1.0)/q)*0.5*scanning_width, -// considering the function f_input defined as -// f_input(y, x) = 0 -// if max(|y|/hh, |x|/ww) > 0.5, and -// f_input(y, x) = input.data[ii*input.real_padded_width() + jj] -// where integers ii and jj are such that -// ii*in_pix_len <= y + 0.5*hh < (ii + 1)*in_pix_len, -// jj*in_pix_len <= x + 0.5*ww < (jj + 1)*in_pix_len, -// using hh = input.h*in_pix_len and ww = input.w*in_pix_len. -// -// Inputs: -// ------- -// scanning_width: scanning width used for sampling the Radon transform -// for every projection angle theta (see above); -// input: padded_matrix defining the function f_input to consider -// when computing Radon transform values (see above). -// Output: -// ------- -// radon_projection: padded_matrix containing the desired samples of the -// radon transform described above. -// The calculations are enqueued to the queue encapsulated -// in this object. -// Returns: -// -------- -// a sycl::event object tracking the completion of the task. -sycl::event acquire_radon(padded_matrix& radon_projection, - double scanning_width, const padded_matrix& input) { - - const double hh = input.h*in_pix_len; - const double ww = input.w*in_pix_len; - if (scanning_width < std::hypot(hh, ww)) { - die("invalid scanning width for acquire_radon"); - } - // helper computing the distance from "origin" to the closest point on one - // of the lines that define a rectangular box (determined by its "center" - // and its "side_lengths") in the direction of vector "+dir_v". - // std::numeric_limits::max() is returned if no intersection is - // found. - auto compute_distance_to_closest_edge = - [=](const double origin[2], const double dir_v[2], - const double center[2], const double side_lengths[2]) { - double lambda = std::numeric_limits::max(); - const double abs_v = sycl::hypot(dir_v[0], dir_v[1]); - for (int dim = 0; dim < 2; dim++) { - if (dir_v[dim] == 0.0) - continue; - for (double bound : {center[dim] - 0.5*side_lengths[dim], - center[dim] + 0.5*side_lengths[dim]}) { - double candidate = abs_v * (bound - origin[dim]) / dir_v[dim]; - if (0.0 < candidate && candidate < lambda) - lambda = candidate; - } - } - return lambda; - }; - const int input_ldw = input.real_padded_width(); - const double *input_data = input.data; - auto integrate_along_line = [=](double theta, double v) { - /* - Let's consider an orthonormal reference frame centered at the center of - the image (say O), using axes aligned with the edges of the image, as - shown below. - */ - double box_center[2] = {0.0, 0.0}; - double box_edges[2] = {hh, ww}; - /* - line L (defined by theta and v) ^ (y-axis) - \ | - \ ww | - _\_______________________________________________ | - | \ | | - | \ | | - | \ | | - | \ | | - hh | \ O | - 0 - | \ | | - | \ | | - | \ | | - |__________\______________________________________| | - \ | - \ 0 | - --------------------------|------------------------------------> - (x-axis) - - Using the following parameters, - */ - const double cs = sycl::cos(theta), sn = sycl::sin(theta); - const double unit_vector[2] = {+cs, -sn}; - const double half_chord = - sycl::sqrt(0.25*scanning_width*scanning_width - v*v); - /* - the coordinates (y, x) of any point lying on the chord that L makes in - the circle of center O and radius 0.5*scanning_width may be - parameterized as - y(alpha) = v*sn + (-half_chord + alpha)*unit_vector[0]; - x(alpha) = v*cs + (-half_chord + alpha)*unit_vector[1]; - where 0 <= alpha <= 2*half_chord is a curvilinear abscissa along L. - The integral of the (piecewise constant) input signal for the range of - alpha s.t. max(|y(alpha)/hh|, |x(alpha)/ww|) <= 0.5 is computed below - */ - // cursor point on L (alpha = 0.0) - double cursor[2] = {v * sn - half_chord * unit_vector[0], - v * cs - half_chord * unit_vector[1]}; - // Move the cursor along L (alpha += dalpha, dalpha > 0.0) into the - // first pixel crossed by L. When moving the cursor, "a little more" is - // added to dalpha to place it _into_ the first/next pixel of the image - // crossed by L (avoiding ambiguous cases of pixel corners lying exactly - // on L). - constexpr double a_little_more = in_pix_len*1.0e-4; - double dalpha = 0.0; - while (sycl::fabs(cursor[0]) > 0.5*hh || - sycl::fabs(cursor[1]) > 0.5*ww) { - dalpha = compute_distance_to_closest_edge(cursor, unit_vector, - box_center, box_edges); - if (dalpha > 2.0*half_chord) { - // no intersection between L and the image was found - return 0.0; - } - for (int dim = 0; dim < 2; dim++) - cursor[dim] += (dalpha + a_little_more)*unit_vector[dim]; - } - // parse the image pixels of indices (ii, jj) visited by the cursor as - // alpha increases, i.e., as the cursor moves along L within the image - int ii = static_cast(sycl::floor((cursor[0] + 0.5*hh)/in_pix_len)); - int jj = static_cast(sycl::floor((cursor[1] + 0.5*ww)/in_pix_len)); - // reset the box_edges to the size of individual pixels - box_edges[0] = box_edges[1] = in_pix_len; - // set box_center to the pixel's center - box_center[0] = -0.5*hh + (ii + 0.5)*in_pix_len; - box_center[1] = -0.5*ww + (jj + 0.5)*in_pix_len; - // compute integral - double integral = 0.0; - while (sycl::fabs(box_center[0]) < 0.5*hh && - sycl::fabs(box_center[1]) < 0.5*ww) { - // find smallest value of dalpha > 0 that brings the cursor to the - // closest edge of the current pixel crossed by L. - // There is always one dalpha s.t. - // 0 < dalpha <= sqrt(2)*in_pix_len - // for any pixel inside the input image, crossed by L. - dalpha = compute_distance_to_closest_edge(cursor, unit_vector, - box_center, box_edges); - // Note: cursor was moved "a little more" into the pixel, previously - integral += input_data[ii * input_ldw + jj]*(dalpha + a_little_more); - // move the cursor into the following pixel - for (int dim = 0; dim < 2; dim++) - cursor[dim] += (dalpha + a_little_more)*unit_vector[dim]; - // set the new pixel indices - ii = static_cast(sycl::floor((cursor[0] + 0.5*hh)/in_pix_len)); - jj = static_cast(sycl::floor((cursor[1] + 0.5*ww)/in_pix_len)); - box_center[0] = -0.5*hh + (ii + 0.5)*in_pix_len; - box_center[1] = -0.5*ww + (jj + 0.5)*in_pix_len; - } - return integral; - }; - - return radon_projection.queue.submit([&](sycl::handler &cgh) { - const int p = radon_projection.h; - const int q = radon_projection.w; - const int radon_ldw = radon_projection.real_padded_width(); - double *radon_data = radon_projection.data; - cgh.parallel_for( - sycl::range<2>(p, q), - [=](sycl::item<2> item) { - const int i = item.get_id(0); - const int j = item.get_id(1); - // -0.5*M_PI <= theta < 0.5*M_PI - const double theta = -0.5*M_PI + i * M_PI / p; - // -0.5*scanning_width < v < 0.5*scanning_width - const double v = (-1.0 + (2.0 * j + 1.0) / q)*0.5*scanning_width; - radon_data[i * radon_ldw + j] = integrate_along_line(theta, v); - } - ); - }); -} - -// Routine reconstructing an S-by-S image of q x q pixels from p x q samples of -// its Radon transform (q samples spanning a scanning width S for every of the p -// projection directions). -// -// Inputs: -// ------- -// R: padded_matrix of height p and width q storing the samples of the radon -// transform. Note that R is modified by this routine; -// S: scanning width used when sampling the Radon transform; -// dep: sycl::event object capturing the dependency to be honored before -// accessing elements of R. -// Output: -// ------- -// image: padded_matrix of height q and width q representing gray-scale pixel -// values of the reconstructed image (square image of side length S). -void reconstruction_from_radon(padded_matrix& image, - padded_matrix& R, double S, sycl::event& dep) { - if (S <= 0.0) - die("invalid scanning width"); - const int p = R.h; - const int q = R.w; - image.allocate(q, q); - if (!image.data) - die("cannot allocate memory for reconstruction"); - std::cout << "Reconstructing image from the Radon projection data" - << std::endl; -/* - Note: in the explanatory comments below, arithmetic operations are to be - understood as similar C++ instructions would, i.e., "x/2" represents - the integer division of x by 2 if x is an integer itself, which is - different from the value of 0.5*x if x%2 == 1. - - The input R to this routine is interpreted as - R.data[i * R.real_padded_width() + j] == radon[f](theta(i), v(j)) - := "R[i][j]" - where - theta(i) = -0.5*M_PI + i * M_PI / p; - v(j) = (-1.0 + (2.0*j + 1.0) / q) * 0.5 * S; - for 0 <= i < p and 0 <= j < q. - - For a given value of theta, let radon_hat(theta, ksi) be the (continuous) - 1D Fourier transform of radon[f](theta, v), i.e., using "1i" := sqrt(-1), - radon_hat(theta, ksi) := - integral (radon[f](theta, v)*exp(-1i*2*M_PI*v*ksi)) dv. - v real - By the Fourier slice theorem, - radon_hat(theta, ksi) = f_hat(ksi*sin(theta), ksi*cos(theta)) - where f_hat is the (continuous) 2D Fourier transform of f, i.e., - f_hat(kappa_y, kappa_x) := - integral integral (f(y,x)*exp(-1i*2*M_PI*(kappa_y*y + kappa_x*x))) dx dy. - y real x real - - Considering ksi = r / S for integers r in [0, q/2], one has - radon_hat(theta(i), r / S) - = integral (radon[f](theta(i), v)*exp(-1i*2*M_PI*(r/S)*v)) dv. - |v| < S/2 - which may be approximated as (midpoint rule) - radon_hat(theta(i), r / S) - ~ \sum_j (R[i][j]*exp(-1i*2*M_PI*(r/S)*v(j))) * (S/q), for j=0,...,q-1 - = exp(1i*M_PI*r*(1.0 - 1.0/q)) * (S/q) * DFT(R[i][0:q[; r), (eq. 1a) - where DFT(R[i][0:q[; r) represents the r-th value of the forward DFT of - the i-th row of q discrete values in R. - Note: radon_hat(theta(i) + M_PI, r / S) = conj(radon_hat(theta(i), r / S)) -*/ - std::cout << "\tStep 1 - Batch of " << p - << " real 1D in-place forward DFTs of length " << q << std::endl; - // Descriptor to compute the DFTs involved in the RHS of eq. 1a, scaled by - // S/q - real_descriptor_t radon_dft(q); - // p values of theta - radon_dft.set_value(dft_ns::config_param::NUMBER_OF_TRANSFORMS, p); - // Distances must be set for batched transforms. For real in-place DFTs with - // unit stride, the distance in forward domain (wherein elements are real) - // must be twice the distance in backward domain (wherein elements are - // complex). Therefore, padding is required in forward domain (as accounted - // for by the padded_matrix structure) - radon_dft.set_value(dft_ns::config_param::FWD_DISTANCE, R.real_padded_width()); - radon_dft.set_value(dft_ns::config_param::BWD_DISTANCE, R.complex_padded_width()); - // Scaling factor for forward DFT (see eq. 1a above) - radon_dft.set_value(dft_ns::config_param::FORWARD_SCALE, S / q); - // oneMKL DFT descriptor operate in-place by default - radon_dft.commit(R.queue); - auto compute_radon_hat = dft_ns::compute_forward(radon_dft, R.data, {dep}); -/* - Using R_data_c = reinterpret_cast(R.data), one has - f_hat((r/S)*sin(theta(i)), (r/S)*cos(theta(i))) (eq. 1b) - ~ exp(1i*M_PI*r*(1.0 - 1.0/q)) * R_data_c[i * R.complex_padded_width() + r] - for 0 <= i < p and 0 <= r <= q/2 (upon completion of compute_radon_hat). - Note that values of i in [p, 2*p) are known too, as the complex conjugates - of their (i-p) counterparts (albeit not stored explicitly). - - The reconstructed image approaches (an elementary cell of) the periodic - replication of f of period S along y and x, i.e., of - +\infty +\infty - \psi(y, x) = \sum \sum f(y - n_y*S, x - n_x*S). - n_y=-\infty n_x=-\infty - Given its periodic nature, \psi(y, x) can be expressed as the Fourier series - +\infty +\infty - \sum \sum \psi_hat[k_y, k_x]*exp(1i*2*M_PI*(k_y*y+k_x*x)/S), - k_y=-\infty k_x=-\infty - wherein - \psi_hat[k_y, k_x] = (1/S^2)*f_hat(k_y/S, k_x/S). - - Given that f_hat(k_y/S, k_x/S) is unknown for hypot(k_x, k_y) > q/2, the - reconstruction function g approximates \psi as its truncated Fourier series, - i.e., - (S^2)*g(y,x) = \sum f_hat(k_y/S, k_x/S)*exp(1i*2*M_PI*(k_y*y+k_x*x)/S). - [k_y,k_x], - hypot(k_y, k_x) <= q/2 - - Sampling the values of g at points (i*S/q, j*S/q) (0 <= i < q and 0 <= j < q, - i and j are integers), one has - G[i,j] = (1/S^2)*iDFT(G_HAT; i,j) (eq. 2) - where G_HAT is a set of qxq (complex) values G_HAT[m][n] (0 <= m < q and - 0 <= n < q, m and n are integers) such that - G_HAT[m][n] = 0.0, if hypot(mm, nn) > 0.5*q; - G_HAT[m][n] = f_hat(mm/S, nn/S) if hypot(mm, nn) < 0.5*q - or if (hypot(mm, nn) == 0.5*q - && mm != 0 && nn != 0) - G_HAT[m][n] = 2*real_part(f_hat(mm/S, nn/S)), if (hypot(mm, nn) == 0.5*q - && (mm != 0 || nn != 0)). - where the notation "xx" represents an integer such that - 0 <= |xx| <= q/2 and mod(x, q) == mod(xx, q) - ('x' being either 'm' or 'n' above). - - The required values of G_HAT[m][n] are interpolated below from the known - values stored in R (using eq. 1b). - Note that G_HAT[q - m][q - n] = conj(G_HAT[m][n]) by construction, given - that f_hat(-ksi_y, -ksi_x) = conj(f_hat(ksi_y, ksi_x)). This is consistent - with the requirements for a well-defined backward real 2D DFT. Therefore, the - values of G_HAT[m][n] do not need to be set/stored explicitly for n > q/2. -*/ - std::cout << "\tStep 2 - Interpolating spectrum from polar to " - << "cartesian grid" << std::endl; - auto interp_ev = image.queue.submit([&](sycl::handler &cgh) { - cgh.depends_on(compute_radon_hat); - const complex_t *R_data_c = reinterpret_cast(R.data); - complex_t *G_HAT = reinterpret_cast(image.data); - const int R_data_c_ldw = R.complex_padded_width(); - const int G_HAT_ldw = image.complex_padded_width(); - cgh.parallel_for( - sycl::range<2>(q, q/2 + 1), - [=](sycl::item<2> item) { - const int m = item.get_id(0); - const int n = item.get_id(1); - const int mm = m - (2*m > q ? q : 0); - const int nn = n; // nn(n) == n since n never exceeds q/2 - const double abs_k = sycl::hypot(double(mm), double(nn)); - const double theta = (mm == 0 && nn == 0) ? - 0.0 : sycl::atan2(double(mm), double(nn)); - // theta in [-0.5*M_PI, +0.5*M_PI] - complex_t G_HAT_mn = complex_t(0.0, 0.0); - if (abs_k <= 0.5*q) { - const int r = static_cast(sycl::round(abs_k)); - const int i = - static_cast(sycl::round(((theta + 0.5*M_PI)/M_PI)*p)); - // if i < 0 or i >= p (e.g., theta = 0.5*M_PI corresponds to - // i == p), the value is mapped to the complex conjugate of - // R_data_c[(i%p) * R_data_c_ldw + r] (e.g., - // theta = -0.5*M_PI if i == p). - // Approximated values of - // f_hat((r/S)*sin(theta(i)), (r/S)*cos(theta(i))): - complex_t f_hat_value = - R_data_c[(i% p) * R_data_c_ldw + r]* - complex_t(sycl::cos(M_PI*r*(1.0 - 1.0/q)), - sycl::sin(M_PI*r*(1.0 - 1.0/q))); // see eq. 1b - if (i%(2*p) >= p) - f_hat_value = std::conj(f_hat_value); - - G_HAT_mn = f_hat_value; - if (2*r == q && (nn == 0 || mm == 0)) { - G_HAT_mn *= 2.0; - G_HAT_mn.imag(0.0); - } - // For a more convenient representation of the reconstructed - // image, shift the target reference frame so that the - // center of the reconstructed image is located at pixel - // of indices (q/2, q/2): - G_HAT_mn *= complex_t(sycl::cos(-2.0*M_PI*m*(q/2)/q), - sycl::sin(-2.0*M_PI*m*(q/2)/q)); - // RHS is ((-1)^m, 0) if q is even - G_HAT_mn *= complex_t(sycl::cos(-2.0*M_PI*n*(q/2)/q), - sycl::sin(-2.0*M_PI*n*(q/2)/q)); - // RHS is ((-1)^n, 0) if q is even - } - G_HAT[m * G_HAT_ldw + n] = G_HAT_mn; - }); - }); - std::cout << "\tStep 3 - In-place backward real 2D DFT of size " - << q << "x" << q << std::endl; - real_descriptor_t q_by_q_real_dft({q, q}); - // Default strides are set by default for in-place DFTs (consistently with - // the implementation of padded_matrix) - // Scaling factor for backward DFT (see eq. 2) - q_by_q_real_dft.set_value(dft_ns::config_param::BACKWARD_SCALE, 1.0 / (S*S)); - q_by_q_real_dft.commit(image.queue); - auto compute_g_values = - dft_ns::compute_backward(q_by_q_real_dft, image.data, {interp_ev}); - compute_g_values.wait(); -} - -// Routine computing the mean global error and pixel-wise mean local errors in -// the reconstructed image, when compared to the (gray-scale-converted) -// original image. The mean error over an area A is defined as -// (1.0/area(A)) integral |f_reconstruction - f_original| dA -// A -// where f_reconstruction (resp. f_original) is the piecewise constant function -// of the gray-scale intensity in the reconstructed (resp. original) image. -// Note: f_reconstruction and f_original are considered equal to 0.0 outside -// the support of the original image. -// -// Inputs: -// ------- -// S: scanning width used when sampling the Radon transform; -// original: padded_matrix containing the original input image's pixel -// values converted to gray-scale values; -// reconstruction: padded_matrix containing the reconstructed image's pixel -// gray-scale values. -// Output: -// ------- -// errors: padded_matrix of the same size as reconstruction, containing -// the pixel-wise mean local errors in the pixels of the -// reconstructed image. -// Returns: -// -------- -// The mean global error. -double compute_errors(padded_matrix& errors, - double S, - const padded_matrix& original, - const padded_matrix& reconstruction) { - const int q = reconstruction.h; - if (q <= 0 || q != reconstruction.w) - die("invalid reconstruction considered for evaluating mean local errors"); - errors.allocate(q, q); - if (!errors.data) - die("cannot allocate memory for mean local errors"); - // the reconstructed image is an S-by-S image of q x q pixels - const double pixel_length = S/q; - const double max_overlap = sycl::min(pixel_length, in_pix_len); - // dimensions of the original image: - const double hh = in_pix_len*original.h; - const double ww = in_pix_len*original.w; - - // helper routines to compute the mean local error in pixel (i,j) of the - // reconstructed image - const int supremum_io = original.h - 1; - const int supremum_jo = original.w - 1; - auto get_original_index = [=](double y, double x) { - int io = static_cast(sycl::floor((0.5*hh + y) / in_pix_len)); - int jo = static_cast(sycl::floor((0.5*ww + x) / in_pix_len)); - io = sycl::max(0, sycl::min(io, supremum_io)); - jo = sycl::max(0, sycl::min(jo, supremum_jo)); - return std::pair(io, jo); - }; - const double* reconstruction_data = reconstruction.data; - const double* original_data = original.data; - const int reconstruction_ldw = reconstruction.real_padded_width(); - const int original_ldw = original.real_padded_width(); - auto compute_mean_error_in_pixel = [=](int i, int j) { - // Notes: - // - pixel of index (i,j) in the reconstructed image covers the area of - // points (y, x) such that - // |y - (i - q/2)*pixel_length| <= 0.5*pixel_length - // |x - (j - q/2)*pixel_length| <= 0.5*pixel_length - // - pixel of index (io,jo) in the original image covers the area of - // points (y, x) such that - // io*in_pix_len <= y + 0.5*hh <= (io+1)*in_pix_len - // jo*in_pix_len <= x + 0.5*ww <= (jo+1)*in_pix_len - // in a common orthonormal reference frame centered on either image - const double y_min = (i - q/2 - 0.5)*pixel_length; - const double x_min = (j - q/2 - 0.5)*pixel_length; - const double y_max = (i - q/2 + 0.5)*pixel_length; - const double x_max = (j - q/2 + 0.5)*pixel_length; - if (y_min > 0.5*hh || y_max < -0.5*hh || - x_min > 0.5*ww || x_max < -0.5*ww) { - // out of scope of relevance, no intersection with the original - // image - return 0.0; - } - // find corresponding range of pixels in original image - const auto io_jo_min = get_original_index(y_min, x_min); - const auto io_jo_max = get_original_index(y_max, x_max); - const double got = reconstruction_data[i*reconstruction_ldw + j]; - double mean_local_error = 0.0; - // parse original image's pixels (io, jo) having a non-empty - // intersection with the reconstructed image's pixel (i, j) - for (int io = io_jo_min.first; io <= io_jo_max.first; io++) { - const double yo_min = -0.5*hh + io*in_pix_len; - const double yo_max = -0.5*hh + (io + 1)*in_pix_len; - double overlap_y = - sycl::min(y_max, yo_max) - sycl::max(y_min, yo_min); - overlap_y = sycl::max(0.0, sycl::min(overlap_y, max_overlap)); - for (int jo = io_jo_min.second; jo <= io_jo_max.second; jo++) { - const double xo_min = -0.5*ww + jo*in_pix_len; - const double xo_max = -0.5*ww + (jo + 1)*in_pix_len; - double overlap_x = - sycl::min(x_max, xo_max) - sycl::max(x_min, xo_min); - overlap_x = sycl::max(0.0, sycl::min(overlap_x, max_overlap)); - const double exp = original_data[io*original_ldw + jo]; - mean_local_error += - sycl::fabs(exp - got)*overlap_y*overlap_x; - } - } - mean_local_error /= (pixel_length*pixel_length); - return mean_local_error; - }; - // compute the mean local errors and the mean global error - double mean_error = 0.0; - double* L1_error = sycl::malloc_shared(1, errors.queue); - if (!L1_error) - die("cannot allocate memory for mean global error"); - L1_error[0] = 0.0; - errors.queue.submit([&](sycl::handler &cgh) { - auto global_integral = sycl::reduction(L1_error, sycl::plus<>()); - double *local_error_data = errors.data; - const int local_error_ldw = errors.real_padded_width(); - cgh.parallel_for( - sycl::range<2>(q, q), global_integral, - [=](sycl::item<2> item, auto& sum) { - const int i = item.get_id(0); - const int j = item.get_id(1); - const double mean_err_ij = compute_mean_error_in_pixel(i, j); - local_error_data[i*local_error_ldw + j] = mean_err_ij; - sum += mean_err_ij * pixel_length * pixel_length; - } - ); - }).wait(); - mean_error = L1_error[0]/(hh*ww); - sycl::free(L1_error, errors.queue); - return mean_error; -} diff --git a/Libraries/oneMKL/computed_tomography/input.bmp b/Libraries/oneMKL/computed_tomography/input.bmp deleted file mode 100644 index 0eabf65f9073f3c738b14a0bb1476a657afb4292..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 480054 zcmeI5d$3(qo#(M6NTu4Q`9r6>N=Qw&P?~DQ2g;yrgCLJKBErlFm&OV<))hkx3PLx^ zD@C-DK&VU#F$0kd6`Mzy*hm@z)3*qXC=;QCL2c|&8%m&gNkX3BjW+XH`@8SD>+ZeJ zKKndw9`}4xE2s9^XP@71t?%CJdw##)-gkYEJ^2Iw^-cSPe;?rgJNUo!4f_9vef~J? z&i+04hx_ak{*V28-T#b$5ikNqzz7%tBVYuKfDtePM!*Od0V7}pjDQg^0!F|H7y%<- z1dMW&>>eR z@#4kz-g_^;+M-eJZIf@M9qVGd?38h_v(l7CU4XRJ!Ic(z*$IFEQt;ldx4Uct$yLF;gQJ*|)2B~=!yDePPm6ziwBLUF!C`P0v<7jtou`F9Fez~Kr>*}%i4A!M zGHGq*Pft4OB(DF0_qK1juwiUC3W5?8ZPECnKl&pGZFqPX;$n2IT)^{%-tvpUS6Ut4 z`+iOh11UIVT%7Al}E!vciwp&{dh5>xdLnK!ZQu|3W}&96WE|5zQXCPx8BOPYHZeYn~z{}_yO{-Jh^lR zW=k#L2+prOxGy{THQ@xM9@(Z3?60&BQ5O!ThhP5kmn#qM`%ZA{`Z_FhyZm-iaqc@5 zHdsc0>B)5qIn)PK|;qX=aSl!#MUVlvJ(q{N^K-Ns$bX)<3;#)+`a9ua_5 zs8ql(eVLwdMlcunL2nyn?P+`kZxiIiQS@a4Y%2>>q&#I`6m8mq*2Nj81BLXHp|OWs zDy^)UuUaAF{kstX!U<+gf5}SI9LgeusE@MtD87O~2txV`1=hG_P)R`)!1<^^i8TeK zUM`Z#WRUc~=Kjd;1xeCxSeaP3}DSy^bwb3FJSt+y9)s>S1#KA&d~Jw zp_X3r3(lzb9KNC_lK}<6RSg0}wuKqT+nOA$yX%CZm6LrO;l0M-?&T{Ib1u&M#_vlx zXoSS-zs0BZzo9jl_@mv30B4Q5N@2dFY{NEGMvaB2gByQbz@!!Yqnys1;-`wMrJn2f zl&UgUNULG)A$$cCYT!4JM9fzDGcK%T5@NU^U*e5cx3mYKC8k=s*nn zz|!g~UF_$470xnV@LTU?_wrSfVV3W)a*p6D(@_)j_PS&EdE(cZ9H84Jf zT?6C84ekqDOPa{&#FPMBZ{et@{32#e2BFd_d)A*EQDu=u$@D4j}B=_bKd>`Z-#g*B?~@!)i0xAPU#mb|zyqf<0sbqalHpZmT| zN=QJJI%T^rBncIh`V}lQB0RPoh54#2L_T1bAyCdi(yN+yqg4i1*+Z^>>eZ=*!Z!1< zGDO+!d_}L|(n4?JTX+oK=pqxWM5)zI?3bU90x?QV;M2>$vROvNpBgn8k@>3C`SSi< zk3c=WH2evU-DcJ^uj4c?Z&32B{7q*v?%uz5uKYul*njde0?|0k$=fJb#UU0#BUr1K zf8{)v6VbNPu3?(5Chv6Ha;FHC(}Xxl+2HX)n54N)MF^>d!Zs7XGGN>7d_}HTLzv8N z9`SY`69CIk9TYI^{Vg0=bFa40J@Zuo5Wn4x2$b(}r_+I}x-xyM>2TYpBe?#{ zU*GL~MX*tG-+}mqxRJ-MdjHq9eoi1)4u{f{()+e-J0v4 zl1{^`I`+SOc^B+MXz}2|qzX1G|M_zP z!yex@dF(2lqw)!bulOM&L2mmGR-_`wc~ z4(Y`M55NfpQsRrmMVHudf}^rYsL<7@q6d6D<59vT)gvuL4UzPOI3JT^3DP-AB+{1jSB*3jr7McdwfW`L_FgVMy8(yva+jBbB{A{WxWxfIpBDc1oCfrC= zOrPPUR@WH&Ijr(0tPK%LL)~v0=r7>C7Cdneq@L7k?#OP56p_w!O2)1gRMgl`*({$LZ2*FT-e<-{D}lBkCQ!l_I^BK5IBw9txhn(!5j!ThZWP9T%| zaFIUL6ma-@nIF>r!)9%(dG&o@wstfzIk+&v`T1y@7t;r*i4&K09y@KnSb2*3!dJ2k zYhev`D)fzh5*62+*~*T^o#v|u#gyOB{HhGpu~o>Yr0XN zjml1a!5N$7$Ru_^-tmI3O5&wgHGQDxou*NY4$S#t+J}1P0TaepI2Tx`A9&3b-e11L z5tl*vK?|;*hUs>>tLCdRCR2M4aRoncg^N7Sk+{JD90px5sR>jFHn{NW!zz83W9kdV z^?Ze2{-xc(Ah8NjAKl=UZT6(c#Dmifrfu7F49=+uv1E;mhOslhATA8@6(%)3ssAF- zwe?=U%*wO7zS_eN3Y?janr%APg==-D?|jAYUAc6?xg!}*e+tV`wAy37YK6>H-OrCQ ze8QA3T<86I3%^w+aS_jYzM^Bj_l+4*ADO5#Oc{u%tvjs2ejEmS@Q>|!w&YVX*~+La zf>61^S75^QL|_U$TTN}qlm4W~vkkj~aHajWJNwR8c%+jcmUfas@jKWBK3FqfwLOVb z?|_&J)z7>18f&tRwVE<}gt4Blh~nxi;ca_DH{h0rf9DH(695z@R9hD{2jHEUr=GDR z6y*)NT{tN)5|gxiBqUZ&2Kg?WQ$D!ip2^^=N`~PqcSov~*7$8|Md=L(?!)$Q1ej3# zlrygjv!iAv)_=s5=d!6O)JH(-`HFOpzVZ9pb;tN(M==KOV92&nR{ikxDXy7`U8iF} zL}v=cJ#1E1dw>zZ3n<|o3lZv0HztFxDo;20a(DeSUv+v;r_AwONTew>Z)qK?!qA7d;*AfW`Khxa>T1*haDt^KL72YA}(zn6r=!RMQ<4ben#PvAb|x0E#II?_o2tB@tKQ zw}9S4V(Bp)+)JfheK21Y&V}FZX$UaCm>^^volaFT6+h@qrH&$sR(!?m6Wc_H=om~` zn7nZoryF7nGF&>-HDh!E1%APSm=FNFOK{>~;|AR*a1k!B9}i%IJBj5=JM`ZCS0l9+ zwB(Z7bJ`tTToUDhbLn<;1;+7uWA8K*6-aDK6shP^xLX4mHW+Cm9Tgx z2*47|+1PlyC%}^SYL|6s7dwRpNeNR%VvfgWEMWiwzrv?5SnuT7cfJBQeqRa!DsPEh zyZgyAU+oEV(0woh1q6uS3MnBG7qgYaV1Poz!jT+bu+YWZzVj6wEiow zb#Yq#6(ca&2vFW3X-Xp#NC`e+KMauWXS?h4sxXTF@)Z#jyi{Oa!opteW16oDr_67S zz#f7CRkAdWQW{0QuD}2sL&VjWKKGZel((kTsvNeL`%@K!5%m=Q|su zgoU6B2B4M|OYuGSp)Y(zqQ@Np$d))Nc0N|yAY1NVblp$$RoBq@i$-8l5ukofT{@le zY^QHU0#w?&dp4ll`Cj;n?2m46kCGe^QY{35>MEUQM7`V>Fkh9=n)euiJplm%6$m6v z31gHJH(&rFneJ-WCWxh&%^|B3#F_8LadZDty za~i#PEPNLp>laG4V+4#qB?1IaJgi$2v9K6Uzk(||FiCtx|H%;B{;8Dts`47}P9v}v zA;2sy|HYhwhxDQMzKp29d<9MMkE%OQx;6;{%~yRni8f*cb|V7Rv01Z%iC;)?*wf2{ z0hJ@_7hlmg%5Efggn!(-Y*=77UsawI?=%8?7Xnn&38i3w^dDtss?**5RZFYk!&j+` zPPge2{iIF>!D5Q~c}KY_e5Jp&@6>OT<4LPqjoSN-fDz~;0!)0KS%Luy|C%IO9d!eP z1sBcV(nHGWa1OogjzxJKqH>tc`%rUa?|%&55t2UG2p9n)U<8bS5ikNqzz7%tBVYuK zfDtePM!*Od0V7}pjDQg^0!F|H7y%<-1dM5cZh=#y`9Ijfeh^H@<^*{l4#1W1EleJ@3lrHvHc% z!Yx>WXy->a-UdxA`h&w{KN^oN*8IhpKf3lNj_iU}h|uU8G;;Nf50(2b7vDJW2v~)Y zb}!-c<{{7z128}&13Hv)e5fpD(X5MtOC$u`npI)pfiXrCcGv*23}vAVlN{VgL95r6@7 zpNnLT_(Wkj&=<2C27>`wg;g+#Xr$gg^F4-hunP857twws!<4M} zVk;N1|01r)TB!?c()j`z;yn#JBNL_&Jv04y+EZ`N8@?Vt@HmH9onD_l-Uy@!P%5Xg zREVq;`NU}+IO@&EKYid|J$Jw?+6!+vmBt2p*dJ$onkuG2mtqp=i)kL2BxNeuXLc9t z^H%d+tQc7ZVxh?e#0aI(l%U}Pwt-AYBsqpI@h$bRFof9u!VqL!_A!Dr5pQ%6hfv^i zbu~pv!$}=&9A5MvTehe8d)o*Yf#wKM0@4jNqLf&$VkSaXn&wQvXW#mX=iYYOO9v0V zeCXL}V-LiYv(^DQaq%tXL`->Ax1bc7n1nqOnB;&Ee#rj6|L6by{2>!uU?0D-A6R9~ zh3vycP!@cW+UITA#lQXW$DeuIsg?HC|8W;t#2ANw3wle>Qx`@1(*v0^gjOzu5(nVr z#bdwlyQg1hes+AM5ikNN0z8AQTYQXU={HR9HJIydWd-rI3D}II{4IIzvE2Vf9WH0Q~P)c z9^Z2=9e}kaxX98{?9)$d7VP7c{IuZWg(J>+@xz~QYM&%-YzVM!w9iHy0xk+ec;Tqw zRzrZ~#l7&AOIYdU=WQd<5d!cPkriY`6v1Q+WOd+iPrUUcF$vS0Ir!2k7jGWAYSZw- zZJ)b#+uUV&``oqcgjJxj=VzWp^deRv{RwrOY`!Z#(HtjG5tF3$pZ>r(FP?DzZ%(`9 zH-CL)+5Xl~FWhq4m5>aq2y2yHKuXxee!&I(4`g`gr=B|e)6j@qgMkNsCp4y+jL zCqsaE%R`Wh${`4%Rznzfamdh%M|{?N)zS6ogN;Cn0DJ{mk?$}cHym(uAd?xNV5UbV zdHFL7HeIlE^QFtTEWCNg)wjO7Y&DIItqWFezi2rO7I@&J7eWh=8?#=41mRG~;HDo# z91>e(DrlsweOzq6>?T}@Rfvv){ljNNT*|Ou6(Src5e}gd2;r#G1xy%*F#kq|uyyGz zaR}Ild+9%v0_WsI$Xtkfm4wFrr}ha88x8@8U|q4I0jk5L^3(C zWZ?=yPN0+nkBc;-m`CSVUa1 zPm~2~DFIYum=9srg}IAt2t^l}{lJPBE#EX}ac=*Vi*pwl_Y%?74I$cR2uoINTfTbx zs=LM^T0O#BAcEMTEGQ8^+&FZ(>sOs#qCVaTLJ~K*Rzu5^iBXL|J1+a>5}T5&6Ij^kJN=Z~=9| zw78)2YWHslL%8*xt=HWSrG);^%Z4EC6)|Qm)c-hy2+_FxrMFZL0e4|s%T~k5kUvbj zW&R4^AB@+YH;h2X2#oIh#pz!O@lTAbW?iVridoED4l^CHx_<*qHTuX;Mj!nd?YA2q z%USD=`?lY9=hkno+H&;`Ii<|LLV*^fp`s8s&hmR_GtXitR0F4xqlL(duq2DDppM{T z!(+LNM}88BQIxWJ9mmK8tdhraqQseJDe=@35uxt%wo`EmThfPd%Eg8F5Wb!0BBPYd z{*o3$$XK`45GGK%h7eK8hJbwlgl`!y6uRTP>pMO{{(=!O0to_JZ@xQCqe#0Z%yfdQ z0+~Qr;uE5*wd*5a1u}uG2y9OLQpnog^O;!0rW`~p#M^PcnzMMEuPVtTqr{v~R^@y} z2n5$*Kf1uO%HveXQ@&ypPy~DeC5{I_;;W2uBkM9ch5#i(xrHGx3i_-Yl;cC-R^u4u z=6n_Sa9tUt!0ICpg%EDZDmt_AOecfMW#>&J&=mqyRDONJ`Q&TLbeQSHR}&(Km<(pY z3DYnSe#qCd;72ok)4Xf8UBBkFAO3_}U^F(if9F1)kbLePXENDoOnlvNjARn>%{0FH z;g5sytP#IKRwQxTB3aE{L_YQE|NhbFBMl7(=h+$<#wLkKRiA@Eur0(mYxHi6X(Df1XgVF-{RDf5Dr`~(nO`R@n2x#}eE_Q6Mg|C?9FjmE9f zoy__zm)*#%e1%vcS(|kskr=@ewe*m3s(wWjH_=5PLy^_O8+P1&&+ndm_Vv+H zegI;@kw!sq7|8JH7up0rqdSQhUq1DcI0S`odQxJ-EzURu-Hf6I~0r8}Y&C`(x(B_Ji9`Fvlp zia;y3Pj&se+f~4atU_4T?4MXS28wBwDX`+$5D4dJ8pW0@a%+Ci4qB_Atn8@_a@#P3 zF_dtJQ$}a9YIgQ~lo99*0Ya2*H{Ka2Wh~{PxE%tmc}vJ>D37bL9rk?XI~WTmb^ zS*mCeWhpTXPX+KiXW}B*zhLR6xr?@~_-=Eul6@$P+XrbN7j6`id(K%Ls3VSorz0{Z z2{olo{s1}84O3$0cIxS0r94#}0=EV}vw$?vkyU3`p^r8K%@G(YH-)=USc^a?UB5K~ zMxZwY2qc(yYJo$lZqN1NfmjH$lj?##M;B}`qFy>&{_d_ALfNbL7y%<-1dM9FvgGGxI-$O@8pd$1fmZqQaq0|MsUC2hGObs!bwI;&mcSgVn zOhACxiD*Z9?omOE)#F){SxP!=@D}=lwK%eiSc~vUlJo`psSCCtF4q1+6VR+R;SBkW z5ikN70!So_NebGm=<-PQo|R5%x9xj4Z-WY0reWF_@JPSc?qNl;tbb2pEAB0dhdd3Z{x=B|Z^Tp_wHC8pLR5Y)7dXCd=)tTkvs1*#F=(VhS<#3$jDQgsa0CcoD0dggN|Yj|VvSP?=%nHf?1X2C zf`0J%`2w58Xp8#?CAH6f7wZeL*Zx3Q-V6a#$-(4`DE>RVv+6RF_%u zK5-y)B#uIkFjbAmvW&~Vxa;TVel4|}cHY}Yzz7Tu0?et55Z5AJ1h&+ zvmQH5qNQRL$OnE?#fehBFR5y6in?_m{@)yTAWDdveZA{A5#)AOoT*`+0+a7(ckbOdp! zc&@U!D(dW10;uc{vVsOvCM?)bUEl@n8;4kxr_Vc$z~CT2aP^~WZxUHSEU-!ptBQK= znF=b)8pkF@Fo;WhLbw(4xR@%6zG4C>vJw*(>_bptnfLvViT1UD7wL9A@qyX?qrbtq zGCfiwP)2~F5Lp{#@Jg~G<`IoR9aGBY~#|RjK0YQLzIL|miR%CDxi_$wuua3dPa*y2RoYQ&BdLdhw7I_8~V(#<#MMyXb<2lxeK1JRs-A z!!!a$po{<#qBPxm%a%_m*OBR`Bro<--gy61J z?_Q5U5Npv$7$x*9`w~5@w+}tST2jPd{h9I*yvGO_fdN54d?m7iSOQt0b@C<}IqG?g;p1g6UDv*vs&`^0sk zMCXH*C(%2Nzy7`yd1YSs@dz#&%9AV_Jt&_!3{ec*6N1Jv`zZ>RM1%eg|+& zz+!?jAbPB;?jo8($rQ30edH&(i${JE?4uvOd^PbK9LVbQeP8f-(9X5TYXtUo1b76C zlrZvD9{fn$xy)DMlT0r@mq;GttId}!gRF>xP`*$@q5>VCya=D^-Aix>7ZdcO$M`Cx z#K4D0Ft1%NzS=l+DIyVjJJjyK5ikP1BfxW*PtFW?_hOly%nmg}YT#(32Ic5X$vq}( zY)JJ!3P~euik2Ugf;vysr$Dz$3N;80a^Dd9QcfiL3L%_aq?B0B2N9!RvWj5OdhxxV zWm_-;Qv(62SQ3j5Pg@-|9P_ntG5Rsef~GfQ5B4eP-+B+h6|{-=YtSO}KOajA(l@NdEj;er#T;<{jZ%4r@!9}6x|637r0h&xix7*FRHX~Nz*Kn||FUJd zP<0#Y{@4f@fx$w6LKc*z5J;4z5QvAbNXoWecRRUZXv!tFTWRi0XY1l5R_ejXU52jerrDG6+CEJVQbU~mMh>_>pA*c(MhF3h!T|~`l^zmPq ztftJ><$)N1{v(iy-G_41v0s2yC})woQPCn63J*aIUAk%BHB!Cr`so5#k;*)*6=JQ! zXNQW}N9G1EJZs9W!!s}E(FIG!_y5e=q7j(72*4_&Z-iT0F1wMo?fNxrhk&P(1h57k z0w?P5@Dki87i@$(j8DJNH51mj^G8O&2n+%O5R2O64R*5aPhQV$*$5Z`BVYuKfDteP z4G{?U3V-<&3eG>e@iv5S5TxLhm6H*>VLzWXwA1P^0xFgYWa)Tx#4w9-*?(ficTgMT zqgG$^ej{K6j6g&HCV@uQoc(2_Z5I8(VKmfjVnd0Z{b=9xBD>6@5YQk(&sWd*5cVaY zgA0~rUNQaM$VRi|DI~^PH?ddVFak!v2ow+?u#w6$@?NRJR}_wC=M(r>N3i&Xsq06JjHjSOw5AC31$Pjx^Kd1JI^XQDgpdmn{MA#F_ zitLOaN_-;eK#816=7v|qDIhM0g(!%MR$I7;tRO3d4zW!51Q)?eB0ve~U|)^5VnzIN z%s;&4!%$XR`#!)37=ZynfXFANfvP4+J3cZMx;c{Kl57O8EJ=#w4GaV4pjZJH!FZ5T z88M7QXe5u7lJru~!8itK2wrGIGW6JozSh6}WXfe_%id!IjKBaQK$(crcbWrAFxr<3j7R$- zMi!ZGo_G%68T62izW&?;0A3bOO(o-zH>F89Uec(NzaiX$wFrb@Io;r+?nI*| zue*L}w8mkIsURYZx3Z5Hxj?Q0?qUVhtvBC2AZNtGGy+DT6#_&=dZ?gGR;gq>1R^0+ zsm8M{O=px(6>cd>R0c-@ibguA%DKWSn5qy~Mf;+`)V{n({Tbq-u?VUQ@2yUv_Zxvh zK!A!9Nt~h}YTz)8azKSWkw(NGs0z}M7mNyn5*ZYq5C|#UB2SE|A{-Tq>aEC1Oo$8F zk1phew?TmQ&BwC>YWUMa|1$zcU{Dd@(M_I7i1`|1MNJ8^dUV?RMOH*Oa0SB6=+3jI z@k<8}r45n6aWVSo$B4LiCFr8TTB>e|sn}LUo&7LdE=fOTA5&%fI1PRem=%d}5}&e8>=?5zHpy3K?9+T96Xfu&D-9@s_kP z6?%@V_OZBDrG4lTDuWeqVLkdmzE(YUBOtztWEF)|rA7Gc(R0E|eVLXG%Zj2tAC_}p zu#%0?E?SNlJ*)+rNor6^^vd9fwTRGkcMqB>GZk7qt?cJ6#_Wr-_St72^OdhyBQVGa zkPq@`6Au^=0!cOXi5Z`WD$nD>sR(-^^t|#;v`vE;1d4$-d=IgBh$SqKJiL(T=tUL? z&6MZ~heTWwqbHhDL*fwQm6G%<-Y)w=&^fb@FWKKVcNvt3Wg;ysi5NYLt_QKy*;nvI)-;y5GwCFh6=>?M zC$aIXgM%c!!YU4HsploVuuSY8R)iAi2{wOo;+I(aeZbF`hi?Q1908ugjA>vVS)Fn* zV)%Y`{;Jhi?Q19049`dibD^MLl}bx&oO5%|Rk7 zk;$V!8>Nj=7W<X4zlx(*-Cz5*5sN@3UC9tQEk zqXQp~xxi!8qenxB1?0W1`+#4o9=;Lak$z2i(MD=MW*+!-}Pq*1XDT##~#vg87?y88h_FLF|(2??(J$2h)Fjerpl z0z8Vz1LWe93Gt6YtXOX!d59bkCL!|4D_09|*m3(k^_3;)D=0f3`-Ko<%{+^0JUQdI zcyx4;C7!Y$iutSVBESn}w5wM1OGM14+XxteDS!ac3r{x@1y%4#76QQ@L_t)mXlw^n z`X#HjKvv&f-;hkC?5wPiC~g8}CC^J>oQD}m14CqW!BWVIux$z;>>(HdBhXI-Mt2fr z1yqw#A&`6J}^spR(7O@<}2yx+pn}*Q^w-?DVLk>8)a}dz>7>$4t z=nn#;JBe_pJ3(K(hUKUF%^`3jX0b094NGDD8J(>d0V7}pjDQg^0!CnWAVBWM0`DyA zN8PE5YE_diBcOwQxoC2{k1+y9zz9SH;3d>;{`Gq!>n{5G%}1Ysx{Vs!>|sBjLNf9A zE;e8%)N@d!N1-*kVC6s-J4J~e^)3#WBzo+kxBiL|Famof0&o#pgm8#NC?rRS6a|fC zlX*q;24aC#Sc|5MA;3b=5j2H@7%o^kUQI4|mBJ3h1u^!>id}TiUoiqkU~fSH>A!Y`kTsh!F<+!RO~&DRmI8K#$P~G)I6)sZ3VVp@5*Gz>Sn6cx6daxC?H9 zvYuG+owiXBWQEW(xulp1MoM+QWFMO}wrP|0@RdZ8mRb(z^TAg(qcxJ5UDSOx@bs9KwPj2v;(stKu?jJ zj1O+1R1QZ`lP9L4bWd0X2NJC*tb*bqQ++>^JH&XjkBij4T&#cl$zBZE7pf630%U3g zKl9)CXT(2{m2yCl6=YJ7j7L>4HtC{@wFrvDTGXAWlXH(x4TDt9Y3x@5sMIe8Y&G_A zBo~P6uwpZd3OdB{3|yF^w| zl3p}|3M!)TNW;^lFvvy_bk6t$){4ZXY)*NcSPQ07Sfz43bt*nB*vC$4Ke~_@J)b@~ zbI2*-fM2d2{(vJurJbS^`I;iD0$CB&h(-`@X3;7{mR~;f?AWBa49Rc|E$GW<5f`t- zW0bi_6;<7e)hgbSIYL%&nk4V}78WY);|Ld0q7TZ^GfuPq;DBGQ9{zwMAbn>Qmk5Cr zSwSWQOE3wdfm*?swXj}3at=DnNI9cHPYVk5ynWBPETPQ8>~M}+;I2%JUX-QVh|pAI zDhWNO_7NovYi(t!_t8Esu#eLyMh|5nJvQLy%fmMUgN%Uqib^EZTep##~kEM z5B(H!gse>UVzz4E=Ao-twGRP$1ee3>=dRuQ>4hjSODtZj1#!VDWR5gg3sQoe^n3!A z#Z(y2KHNX8RWMW%vAq-vV!O^l$7Bk>x<;vp7T zC5X|FDbZ`OP!SgbVNez{l{3{_Pl}TCirHBG7^Vt~!=pmD^3G^KxImFd_AgovWd*ZG zoa6e{AYZE`L51io6eX6rXsNs=C7QE)~2rmT=Uc`inu@YT3jYNAIE2VyqZ z&s+riYu6KfiLcPP@bm4yT#bMckhpV92FK$oDKDqVAbc`LR>;Q(K8a-Yl_10nt59W< zegx%ll;{!Jkr;jcXv9&&WlGHR%`6$jesDqjHu8|-t4v4i8YhFkP>p~Q00HtWq_xP} zqPVjv;S{C_ZxCG0L#+EZ5c7maCWtEi9rxvAl}XZ9i+qjllyn!Y73?1}MBEiL!cMz{ zry~fQogaCi)g0eFqP^}y)+Mj#>D6q0#WpaJqWbaLVH$qt321B>W_@Tz#>4DMPew*Qj|qvNcjlrfKrHdXl&@| zg)SuNNjxcP5y(XsB!;2(K5q%Eg%`C@u*y{L5qkDL!GXORJ#Zt?76DNT<)#xWImN0TWi2?qlb? zVFZkT5hx)LNQoPKJ6=;`yGNQTd3e2Ge^Ojjc=awLU<8bS5ikNqzz9?zK+J=@De`}a zJJ8tRZ7NSw@tsa~5lXSNJ33zykKh#r9QO1v#G|S@^Mt5Mj~8Ta*u#E4WnqV|M+@W8L;8t` z7=4xtsnU;&-9P<&FGJ|MZ~meYFarHTfN4Im=$n$W5lu18k;;lPG;APDgHk+NS{&S| zUnl}DT66Z7#e_00`*Oi6P10Q)*#)IQbTAb|h%^=L%Q%ZOGX!K<5u>-VbEjv}#~Xn? z1OZaBRMk{uqNUea&=?IGwcGYRoW6N*ESH^meU`5?Hy?tJGy+CoPe6b=Pl2q6MhbGt ztZA&qdZ8?F%#_!BZ&GmzVb8TUiAltPuoKiI(LkwjVOB~vc##Vz1$EShxuN)0WGI?S zUC20&XgI|+pF(2mjy!|9*`9C;+y^6I1ezdFNmkGilbYELdq~$tvJUZ;{d~%Nucs8) z3??B5q;?c?y)hMLzAJW$>NcoRMB{9*Dk&}`MqeKVach8bJ+(E(RIreGp4!J6_GxU; zq+lpkWChfY0>vhf`WPc%1SSIks^9A_`g+uhk5e8#iIVXs`q7X#Mbklz#n`1y1Es(Z z1X?f#v!3(~f}*hjjleS)CkG_EOrtfv6=_P6@e&QhY}#-Ex6l*HO@wEZo5GV?i3>t6 zq9e$V$Soy9F_kzf+D~0br6RH-i=bk8GT^mMBVYvjhye2)K0z-&W>N$vDN{jHsj54= zeri#38CoF2B6ovTC~7@$`BECU`E-X-budM190rpVn5t}Fim1H8jUq;|qU>Y2?1CIK z&}NqIi3|y)#8lC~6jY`7%n;-S7jW0Z2Yrk`$L=GlHf02iz+@o6+!t9XK8a+-WKU^I zlJRIUtML|X8qIo93M@n*1Y@Xd4nfg~sT5YVViGtc3NfcHqW$QCSO_A*h3xYhU9iDh zJ{lv#Ttb?Fs+E0>0_jyoA(0(IES`R!41{gd2pECBAV5CFBTs}tDOnMjDElK6i5!C7 zA5GeSLH;k3iPwA=r6^D-bAcFfp)wZ?sRC3=hPa4f zRb)c3Q^7^9V>l)r&7#d-Sf(!*m5msINkV{RFqXlY^`wDivVxi<>5g=J+SnP?mNVi~ zlmc<7DV0-1q*78L2ZY=>l5asuGE#Pt+K+)y>H^||ov@#}5LscLK5#H(C>Le>jODol zX3_X4v>B)IC(@IIv&|X-BhWhn+}hLA1&|f-kI0I!gqf~sjxuRj7yXbSblYi2A*;Q7 z=-DqFJj9e2tDplI+Vl_<5zN36SRhY?PsCJgKwmHnJH;e{tTIV@76sMP>#gj|MIgq^ zMNCMsgH7zqMYJ!niuQBW`>G+tQ7}vnW1aclA+-e~U<4)!0iN-u_(RPql2ss+OwwI) zeqs6I4}Ts7WEA>PhmURZiI+$z9;$(GB)FUt%lYmr5URbD=F4(kuYDiD{5MRlRbCuOFJ!l`Hx z<_oP4FJuYO3HHa7=*5cBg_5{XK+6hTP$Jz{OI7JL1PMv!ON`E0To?sIKdZ?JRyyW8>9jtAkSfMa!A;L7eNOnR@9_ z!$A{p=2_&45Ero)L5?^?G)PP(rh*K|nF>|YOP7abkjK0P`(sM*I{TD)1QVuCvxUGW2pmJO+0`T(}@2 zl8b0RN=TRWaYBbtd5#i1cib0r#FnjwEdw)uG??`xSbe#uY{Upm5&}Fi&ZCm>6_Jm~ zipd)UWuj92-48%hxiWI5WSS^1k4O>=c?gu^X(AS4GgymQ3wENk1*Oo~5LrPBd4iTv zVy-{9c0FED2E=%15~E+c9!il=j$FWvupGn%9f=i1S=cA6Vmqd>fpVi>*orlxTx1P3 zknthhdJiMTY~ar`FJ~R*Ny6D?jers89RdDu<`<`bB?Lc*eu}UsBzGieWKUx79T`y<}4POq#+PYMT1O86(ukcyp+i#Bdh2oPztK4P}XgC zVjotK9zA>&qd29XSkCPydi2C&L3Sq@h*)=mee~#&WF6C^XZ3jhNlx!qlr0#6NkstN zhbLza5&V?-st}gM$<9U|qTKy}_yjTu!Br+bBXI|$29c+MOmyq5$XCM)NyNsZxH2n_ zNybN&XZR2n3NAA72wnp#j=2c-BVWzBF!0qx;vJ6?GuDlKD89lhI7}+eHf{urK<@}h zES~uuo+~)z;#9^xRCuzQ51~$ovVQnurny>Bb*G%Qc0H2uA@cdkbx7NwJHsR5Axc3x zV#{_OzvPY^(p_kn!dl`J<%23-QJ#V>Bo;p*A5=<6{B!Sv2t9}RZQ%{b5eAX3C!Y<9 zftgALzNk1M>x^_)A%q*x2bbQ$J%T{IP+~bB#Q4%%U^a~V;r8CIC0j58y8wZpyo|;u zxAs0VSIHVBtZ>hctWc9ZtAqzifw;033gaYGkk!H)kVu9`TK(}IJivXoz*gEaP_)84P1BwOwx*}(h*R~hO)#bl*)_GOJrj7xqXN$a{(D<3FCJg$q|n3gcSqp z9x@c3aZN@sPQ2L=@DlpJ^3G7nN0NT-qA&#iGXh3nuRFN0 z;}By1gDU;pMdX-G__k_5-e&}i!0tm}bSH@+loDjzk2r^{iYN%y3R8a0;xN0_vWE&_ zl8^&-_z&`-qNUtZQBZi0fZBNWeEYbIIg82BV3H2VD(ea4Np3iS6=z*YxEOLnhA?kQ zaKY>FLYz{w3TdF%km>Lw`fww#=O93}T;(RQ7O@t&Rd`C1cFM)vM?*M1+)C?Vnv>tD zNM3Z2+2=VZO7}fI3N^Zu9+G}ypA1(IQRGA5*5TL?Lfzi~jDQi?`w?I+6KfF*QOAZ` zXmAJt4*^Mkra3qGo_+yV2`+HAZ4$Z^ z%3ovlo0q~m>&Te>zR+N2u6?u-FalEu0XRy^6jG6xjFANws8nP^6_a7#HjRK0nA!-y zA!wT-se|eb0y;=Y(AZ`V`}-1Tq5Fe64+^akzmQ4=>rt?zYC}Q8seKAOIwN2NnjnDe zmqfm#bAc`o3&_WYR6U<|A$A{K6RM$QFQI3Q7wn@ z5?M*=Lc;M9(_tG*K?NfS4tAn% z0OW(Psf1ZYRw9$AqsmIBYPV%tU80oclm%IlPJZLPABU-=`if;qePNI_pLtb7sgTA; z2pWqV&j(KotVe4hdQ$D}_~&sSx~PnNul8=#?d!;VvkJC}`s^pK4ptBDwqN zZT~23GD0cQ6c!{UCIKB>(AZ`tjZdL3^zK=-u&T@6X9SGEAR<5jGqUKLQSx471*H)4 zh)G7K1%*?jxLE964G9UBl!snmm32p+K@`-gNUj`^k{5-qRFXb&Aa*b=`?$a|+w6oG zMPKXRelkV)K|C=Yvk@=?B?PD`Mag@}iui|g3_g+Sy%Ynb(2A585)w3&bWo9iyC4=g z4Y7NQKJPFBMqr8{ z0KHJQiUliJB}(2C=R}%9OIi)>Ldh2**CqKIu@?MBNVe*rV<V|q*V};PRxt;JtO%$?Q(_MZ7fK^u+dLIgwZWJwim4PmFbk6O6YZB>NPv|NJU!zy{=|FGPngGV1O^y^@XXa; zoEgbV!4HuYWFjVkk;0;*GtWW@HAurBIR`;!wWt&ySxe!T(mDb&NJ&wan2LfGZ;8G{ zR)OLUI3B65VE>RI>|?xOpPf>7#RbiJsRMkedgw;rb@UB+8bQx3@X!K$LQWULp2#HG z`c%l3BC@>Yv@20_Mk7AR#1CD?TlT|RunlpMD1|_XB#z_`*1`_fL{nla-bO8H6bTV2 zi|b!uADhuWE`qxggR*mEEf%!#IWq!AU|+i$<@ zCK_uaYeRbXVl7DxLREwf*1=gXDzt6XgOl^*e9HW zvM_GG8rTcf12+O7Kt9N$O%#_zRzWyE6Ou;jaDqw>a?;CJqXB_}m>OdA(z}OMSj|`( zsVvbfC3;0%WT8Wjerpd z2t2dkTQLn3S%r1r3uFb8WMZa4LV8R*I;aHRabMJrM&J3Bzgxl=(T{*$6cLdgqLd0* z@d{Z5Ju;McAfLa!GS_!b^-`nc{g`+(loj++FIXD*bLjF;tR3isZ$q7R0nb;o@n%}nE~4UZAgu^%}?_zKY+ zOFVaaW_`R7n34#PXT5mr7f9KNe3IoaIX%z7TW(EKX-7!fnc!5t>O3wZ&@}@5?KA475~CMog~GeC zHlE>JvWiktXiIN_Ny6R0EC=i;O(S8PAVz=6#d1Lq6>3=vR$@6ApMPVhSq(2BvLbS$ zV_gr*Uo-+nV9FveR&L6b=($(Og9OyZhZj;FC)x?Ga~4xq-?rkrA?!iww8MX7c08s| zZm3!ofmVp+PX8*g76gSOHnJO(*ATf?6vR4o=fjPF5t!l#jIkE67Ul6!(fY_-o^zmW zJo9o&-!N4#OHmOo!CJ&}q=yhA6)jv4(b0G)bkliPi>Vw|P4Uaj!!rW?LqM#;5-$7| z4ApX8p(%K#k2C`5QPh(C+{M2GGyR11lxu?O_jerrTMc~yPJ5YH>l0M3Zp>;@OLFTk+ zC#+Q?!&>Xd9~uE8U<7(XfFc#zsZx<9ppwW1QeUjbjD}8ZyhW*y{WN4)fAIPFR!Z#& zcYoOk7=aEEpo$(P??qO~hrvsT5=N;nmN}(KPlug+1c`CXWAm?f5xzsbeYg=Y0^K8k zDr=OyC$f^(A*2LBA<83N9tqR4GBfL)(pXYn^z{#K`7q+nrmXJK_cx7z5onA62^}{9 zRkMm@C1F;WDpjR_blUrA2!7F!s6hNn^tJx&CsU3NL;tcdKeVl#^hI>hSc1o%5fzz8%(fG4TK(+h7rv`ki!sib-@ReH1w z$J?8amo6CG_3IPPZ@6$x$)R7kCZbS z_sG!m$~Jr8E?5gTqp<|d1k-+F1dMI5z~JJ$gd8k~!g3}1bf{JvlYHFFU;3!svpsqzBix3O$az0pbZoJC~7=bDT>hE@EZuSYJvG9t@R-W!kP>w&w%G$aQMuxkiWZHm5biQxRh<^^ zGXh4S0s*S!1u`(zA8<5rx7p$MxcNI z41;F$#^FU#?4EK~sK7&9r+<~Y7Ozsh4^M}V=Fd|VjQFh)FakzkmmxrI$itufJs`xj zap-a$U#GFbLspd55x%c^)M}S?(vFOP5ikNqzz7%tBVYuKfDtePM!*Od0V7}pjDQg^ z0!F|H7y%<-1dM - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/fourier_correlation/GNUmakefile b/Libraries/oneMKL/fourier_correlation/GNUmakefile deleted file mode 100644 index 6cbf83d561..0000000000 --- a/Libraries/oneMKL/fourier_correlation/GNUmakefile +++ /dev/null @@ -1,26 +0,0 @@ -# Makefile for GNU Make - -default: run_all - -all: run_all - -run_all: fcorr_1d_buff fcorr_1d_usm fcorr_2d_usm - ./fcorr_1d_buff 4096 - ./fcorr_1d_usm 4096 - ./fcorr_2d_usm - -DPCPP_OPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl="blas,dft,rng,vm" - -fcorr_1d_buff: fcorr_1d_buffers.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -fcorr_1d_usm: fcorr_1d_usm.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -fcorr_2d_usm: fcorr_2d_usm.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -clean: - -rm -f fcorr_1d_buff fcorr_1d_usm fcorr_2d_usm - -.PHONY: run_all clean all diff --git a/Libraries/oneMKL/fourier_correlation/License.txt b/Libraries/oneMKL/fourier_correlation/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/fourier_correlation/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/fourier_correlation/README.md b/Libraries/oneMKL/fourier_correlation/README.md deleted file mode 100644 index c5907a2c14..0000000000 --- a/Libraries/oneMKL/fourier_correlation/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# Fourier Correlation Sample -The cross-correlation has many applications, *e.g.*, measuring the similarity of two one-dimensional signals, finding the best translation to overlay similar images, volumetric medical image segmentation, etc. This sample shows how to implement one-dimensional and two-dimensional cross-correlations using SYCL, and oneMKL Discrete Fourier Transform (DFT) functions. This samples requires oneMKL 2024.1 (or newer). - -For more information on oneMKL, and complete documentation of all oneMKL routines, see https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html. - -For more information on supported systems and the corresponding requirements, see https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-base-toolkit-system-requirements.html. - -## Purpose -This sample shows how to find the optimal translational shift maximizing the cross-correlation between two real, periodic signals $u$ and $v$ in ${ℝ}^{n_{1}\times n_{2} \times \ldots \times n_{d}}$, *i.e.*, the (integer) value(s) $s_{i}, \ i \in \lbrace 1, \ldots, d\rbrace$ maximizing - -$$ c_{s_{1}, \ldots, s_{d-1}} = \sum_{j_{1} = 0}^{n_{1} - 1} \cdots \sum_{j_{d} = 0}^{n_{d} - 1} u_{j_{1}, \ldots, j_{d}} v_{j_{1} - s_{1}, \ldots, j_{d} - s_{d}}.$$ - -> **_NOTE:_** Given the periodic nature of $u$, $u_{j_{1} + k_{1} n_{1}, j_{2} + k_{2} n_{2}, \ldots, j_{d} + k_{d} n_{d}}$ and $u_{j_{1}, j_{2}, \ldots, j_{d}}$ are equal $\forall \\lbrace k_{1}, \ldots, k_{d}\rbrace \in {ℤ}^{d}$; the same remark holds for $v$. - -Discrete Fourier transforms may be used to evaluate the above $c$ efficiently, via - -$$ c = \dfrac{1}{\prod_{i = 1}^{d} n_{i}} {𝓕}^{-1} \left({𝓕}(u) \odot \left({𝓕}(v)\right)^{*}\right) $$ - -where ${𝓕}$ (resp. ${𝓕}^{-1}$) represents the forward (resp. backward) unscaled Discrete Fourier Transform, $\odot$ represents a component-wise product, and $\lambda^{*}$ is the complex conjugate of $\lambda$. - -The implementations use SYCL and oneMKL. SYCL provides the device offload and host-device memory transfer mechanisms. oneMKL provides interfaces to compute forward and backward transforms on the device as well as other required functions like the component-wise product of two complex sequences. The result of the operation described above is compared with a naive SYCL implementation and the two are verified to be within numerical tolerance of each other. - -## Implementation Details - -In this sample, two artificial signals are created on the device. Their cross-correlation is evaluate 1) via a naive SYCL implementation and 2) by using the DFT-based procedure described above. The host retrieves the results and verifies that they are within numerical tolerance of each other. The optimal shift maximizing the cross-correlation between the signals is also extracted on the host, and reported as a normalized correlation score - -$$ \rho_{u, v} = \dfrac{1}{\sigma_{u}\sigma_{v}} \left( \max_{\lbrace s_{1}, \ldots, s_{d} \rbrace} \dfrac{c_{s_{1}, \ldots, s_{d}}}{\prod_{i = i}^{d}{n_{i}}} - \overline{u}\overline{v} \right)$$ - -where $\overline{x}$ and $\sigma_{x}$ are the average value and standard deviations of $x$, respectively. - -Two implementations of the one-dimensional algorithm are provided: one that uses explicit buffering and one that uses Unified Shared Memory (USM). Both implementations compute the cross-correlation on the selected device. A two-dimensional Fourier correlation example using USM is also included, illustrating how to define and use a two-dimensional data layout compliant with the requirements for in-place real-to-complex and complex-to-real transforms. - -## License -Code samples are licensed under the MIT license. See [License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt) - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see -[Using Visual Studio Code with Intel® oneAPI Toolkits](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -After learning how to use the extensions for Intel oneAPI Toolkits, return to this readme for instructions on how to build and run a sample. - -## Building and Running the Fourier Correlation Sample - -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux Sudo: . /opt/intel/oneapi/setvars.sh -> -> Linux User: . ~/intel/oneapi/setvars.sh -> -> Windows: C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat -> - ->For more information on environment variables, see Use the setvars Script for [Linux or macOS](https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2023-1/use-the-setvars-script-with-linux-or-macos.html), or [Windows](https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2023-1/use-the-setvars-script-with-windows.html). - -### On a Linux System -Run `make` to build and run the sample. One two-dimensional program (using USM) and two one-dimensional programs (one that uses explicit buffering and one that uses USM) are created. - -You can remove all generated files with `make clean`. - -### On a Windows System -Run `nmake` to build and run the sample. - -Note: To remove temporary files, run `nmake clean`. - -### Example of Output -The one-dimensional programs generate two artificial one-dimensional signals, computes their cross-correlation, and report the optimal (right-)shift for the second signal maximizing its correlation score with the first. The output should be similar to this: -``` -./fcorr_1d_buff 4096 -Running on: Intel(R) Data Center GPU Max 1550 -Right-shift the second signal 2048 elements to get a maximum, normalized correlation score of 1 (treating the signals as periodic). -Max difference between naive and Fourier-based calculations : 2.38419e-07 (verification threshold: 6.66459e-06). -./fcorr_1d_usm 4096 -Running on: Intel(R) Data Center GPU Max 1550 -Right-shift the second signal 2048 elements to get a maximum, normalized correlation score of 1 (treating the signals as periodic). -Max difference between naive and Fourier-based calculations : 2.38419e-07 (verification threshold: 6.66459e-06). -``` -For the two-dimensional case, the program generates two artificial two-dimensional images, computes their cross-correlation, and report the optimal translational vector for the second image maximizing its correlation score with the first. The output should be similar to this: - -``` -./fcorr_2d_usm -Running on: Intel(R) Data Center GPU Max 1550 -First image: -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 1 1 0 -0 0 0 0 0 1 1 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -Second image: -0 0 0 0 0 0 0 0 -0 1 1 0 0 0 0 0 -0 1 1 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -Shift the second signal by translation vector (3, 4) to get a maximum, normalized correlation score of 1 (treating the signals as periodic along both dimensions). -Max difference between naive and Fourier-based calculations : 1.19209e-07 (verification threshold: 4.91989e-06). -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/fourier_correlation/fcorr_1d_buffers.cpp b/Libraries/oneMKL/fourier_correlation/fcorr_1d_buffers.cpp deleted file mode 100644 index 0a30c107ec..0000000000 --- a/Libraries/oneMKL/fourier_correlation/fcorr_1d_buffers.cpp +++ /dev/null @@ -1,207 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= -// -// Content: -// This code implements the 1D Fourier correlation algorithm -// using SYCL, oneMKL, and explicit buffering. -// -// ============================================================= - -#include -#include -#include -#include -#include -#include -#include - -static void -naive_cross_correlation(sycl::queue& Q, - unsigned int N, - sycl::buffer& u, - sycl::buffer& v, - sycl::buffer& w) { - const size_t min_byte_size = N * sizeof(float); - if (u.byte_size() < min_byte_size || - v.byte_size() < min_byte_size || - w.byte_size() < min_byte_size) { - throw std::invalid_argument("All buffers must contain at least N float values"); - } - Q.submit([&](sycl::handler &cgh) { - auto u_acc = u.get_access(cgh); - auto v_acc = v.get_access(cgh); - auto w_acc = w.get_access(cgh); - cgh.parallel_for(sycl::range<1>{N}, [=](sycl::id<1> id) { - const size_t s = id.get(0); - w_acc[s] = 0.0f; - for (size_t j = 0; j < N; j++) { - w_acc[s] += u_acc[j] * v_acc[(j - s + N) % N]; - } - }); - }); -} - -int main(int argc, char **argv) { - const unsigned int N = (argc > 1) ? std::stoi(argv[1]) : 32; - // N >= 8 required for the arbitrary signals as defined herein - if (N < 8 || N > INT_MAX) - throw std::invalid_argument("The period of the signal, chosen as input of " - "the program, must be 8 or greater."); - - // Let s be an integer s.t. 0 <= s < N and let - // corr[s] = \sum_{j = 0}^{N-1} sig1[j] sig2[(j - s + N) mod N] - // be the cross-correlation between two real periodic signals sig1 and sig2 - // of period N. This code shows how to calculate corr using Discrete Fourier - // Transforms (DFTs). - // 0 (resp. 1) is returned if naive and DFT-based calculations are (resp. - // are not) within error tolerance of one another. - int return_code = 0; - - // Initialize SYCL queue - sycl::queue Q(sycl::default_selector_v); - std::cout << "Running on: " - << Q.get_device().get_info() - << std::endl; - // Initialize signal and correlation buffers. The buffers must be large enough - // to store the forward and backward domains' data, consisting of N real - // values and (N/2 + 1) complex values, respectively (for the DFT-based - // calculations). Note: 2 * (N / 2 + 1) > N for all N > 0, since - // 2 * (N / 2 + 1) = N + 1 if N is odd - // 2 * (N / 2 + 1) = N + 2 if N is even - // so max(N, 2 * (N / 2 + 1)) == 2 * (N / 2 + 1) - sycl::buffer sig1{2 * (N / 2 + 1)}; - sycl::buffer sig2{2 * (N / 2 + 1)}; - sycl::buffer corr{2 * (N / 2 + 1)}; - // Buffer used for calculating corr without Discrete Fourier Transforms - // for comparison purposes (calculations entirely done in forward domain): - sycl::buffer naive_corr{N}; - - // Initialize input signals with artificial "noise" data (random values of - // magnitude much smaller than relevant signal data points) - std::uint32_t seed = (unsigned)time(NULL); // Get RNG seed value - oneapi::mkl::rng::mcg31m1 engine(Q, seed); // Initialize RNG engine - // Set RNG distribution - oneapi::mkl::rng::uniform - rng_distribution(-0.00005f, 0.00005f); - - oneapi::mkl::rng::generate(rng_distribution, engine, N, sig1); - oneapi::mkl::rng::generate(rng_distribution, engine, N, sig2); - - // Set the (relevant) signal data as shifted versions of one another - Q.submit([&](sycl::handler &cgh) { - sycl::accessor sig1_acc{sig1, cgh, sycl::write_only}; - sycl::accessor sig2_acc{sig2, cgh, sycl::write_only}; - cgh.single_task<>([=]() { - sig1_acc[N - N / 4 - 1] = 1.0f; - sig1_acc[N - N / 4] = 1.0f; - sig1_acc[N - N / 4 + 1] = 1.0f; - sig2_acc[N / 4 - 1] = 1.0f; - sig2_acc[N / 4] = 1.0f; - sig2_acc[N / 4 + 1] = 1.0f; - }); - }); - // Calculate L2 norms of both input signals before proceeding (for - // normalization purposes and for the definition of error tolerance) - float norm_sig1, norm_sig2; - { - sycl::buffer temp{1}; - oneapi::mkl::blas::nrm2(Q, N, sig1, 1, temp); - norm_sig1 = temp.get_host_access(sycl::read_only)[0]; - oneapi::mkl::blas::nrm2(Q, N, sig2, 1, temp); - norm_sig2 = temp.get_host_access(sycl::read_only)[0]; - } - // 1) Calculate the cross-correlation naively (for verification purposes); - naive_cross_correlation(Q, N, sig1, sig2, naive_corr); - // 2) Calculate the cross-correlation via Discrete Fourier Transforms (DFTs): - // corr = (1/N) * iDFT(DFT(sig1) * CONJ(DFT(sig2))) - // Initialize DFT descriptor - oneapi::mkl::dft::descriptor desc(N); - // oneMKL DFT descriptors use unit scaling factors by default. Explicitly set - // the non-default scaling factor for the backward ("inverse") DFT: - desc.set_value(oneapi::mkl::dft::config_param::BACKWARD_SCALE, 1.0f / N); - desc.commit(Q); - // Compute in-place forward transforms of both signals: - // sig1 <- DFT(sig1) - oneapi::mkl::dft::compute_forward(desc, sig1); - // sig2 <- DFT(sig2) - oneapi::mkl::dft::compute_forward(desc, sig2); - // Compute the element-wise multiplication of (complex) coefficients in - // backward domain: - // corr <- sig1 * CONJ(sig2) [component-wise] - auto sig1_cplx = - sig1.template reinterpret, 1>(N / 2 + 1); - auto sig2_cplx = - sig2.template reinterpret, 1>(N / 2 + 1); - auto corr_cplx = - corr.template reinterpret, 1>(N / 2 + 1); - oneapi::mkl::vm::mulbyconj(Q, N / 2 + 1, - sig1_cplx, sig2_cplx, corr_cplx); - // Compute in-place (scaled) backward transform: - // corr <- (1/N) * iDFT(corr) - oneapi::mkl::dft::compute_backward(desc, corr); - - // Error bound for naive calculations: - float max_err_threshold = - 2.0f * std::numeric_limits::epsilon() * norm_sig1 * norm_sig2; - // Adding an (empirical) error bound for the DFT-based calculation defined as - // epsilon * O(log(N)) * scaling_factor * nrm2(input data), - // wherein (for the last DFT at play) - // - scaling_factor = 1.0 / N; - // - nrm2(input data) = norm_sig1 * norm_sig2 * N - // - O(log(N)) ~ 2 * log(N) [arbitrary choice; implementation-dependent behavior] - max_err_threshold += - 2.0f * std::log(static_cast(N)) - * std::numeric_limits::epsilon() * norm_sig1 * norm_sig2; - // Verify results by comparing DFT-based and naive calculations to each other, - // and fetch optimal shift maximizing correlation (DFT-based calculation). - auto naive_corr_acc = naive_corr.get_host_access(sycl::read_only); - auto corr_acc = corr.get_host_access(sycl::read_only); - float max_err = 0.0f; - float max_corr = corr_acc[0]; - int optimal_shift = 0; - for (size_t s = 0; s < N; s++) { - const float local_err = std::fabs(naive_corr_acc[s] - corr_acc[s]); - if (local_err > max_err) - max_err = local_err; - if (max_err > max_err_threshold) { - std::cerr << "An error was found when verifying the results." << std::endl; - std::cerr << "For shift value s = " << s << ":" << std::endl; - std::cerr << "\tNaive calculation results in " << naive_corr_acc[s] << std::endl; - std::cerr << "\tFourier-based calculation results in " << corr_acc[s] << std::endl; - std::cerr << "The error (" << max_err - << ") exceeds the threshold value of " - << max_err_threshold << std::endl; - return_code = 1; - break; - } - if (corr_acc[s] > max_corr) { - max_corr = corr_acc[s]; - optimal_shift = s; - } - } - // Conclude: - if (return_code == 0) { - // Get average and standard deviation of either signal for normalizing the - // correlation "score" - const float avg_sig1 = sig1.get_host_access(sycl::read_only)[0] / N; - const float avg_sig2 = sig2.get_host_access(sycl::read_only)[0] / N; - const float std_dev_sig1 = - std::sqrt((norm_sig1 * norm_sig1 - N * avg_sig1 * avg_sig1) / N); - const float std_dev_sig2 = - std::sqrt((norm_sig2 * norm_sig2 - N * avg_sig2 * avg_sig2) / N); - const float normalized_corr = - (max_corr / N - avg_sig1 * avg_sig2) / (std_dev_sig1 * std_dev_sig2); - std::cout << "Right-shift the second signal " << optimal_shift - << " elements to get a maximum, normalized correlation score of " - << normalized_corr - << " (treating the signals as periodic)." << std::endl; - std::cout << "Max difference between naive and Fourier-based calculations : " - << max_err << " (verification threshold: " << max_err_threshold - << ")." << std::endl; - } - return return_code; -} diff --git a/Libraries/oneMKL/fourier_correlation/fcorr_1d_usm.cpp b/Libraries/oneMKL/fourier_correlation/fcorr_1d_usm.cpp deleted file mode 100644 index ee964dc12b..0000000000 --- a/Libraries/oneMKL/fourier_correlation/fcorr_1d_usm.cpp +++ /dev/null @@ -1,207 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= -// -// Content: -// This code implements the 1D Fourier correlation algorithm -// using SYCL, oneMKL, and unified shared memory (USM). -// -// ============================================================= - -#include -#include -#include -#include -#include -#include -#include - -template -static bool is_device_accessible(const T* x, const sycl::queue& Q) { - sycl::usm::alloc alloc_type = sycl::get_pointer_type(x, Q.get_context()); - return (alloc_type == sycl::usm::alloc::shared - || alloc_type == sycl::usm::alloc::device); -} - -static sycl::event -naive_cross_correlation(sycl::queue& Q, - unsigned int N, - const float* u, - const float* v, - float* w, - const std::vector deps = {}) { - // u, v and w must be USM allocations of (at least) N device-accessible float - // values (w must be writable) - if (!is_device_accessible(u, Q) || - !is_device_accessible(v, Q) || - !is_device_accessible(w, Q)) { - throw std::invalid_argument("Data arrays must be device-accessible"); - } - auto ev = Q.parallel_for(sycl::range<1>{N}, deps, [=](sycl::id<1> item) { - size_t s = item.get(0); - w[s] = 0.0f; - for (size_t j = 0; j < N; j++) { - w[s] += u[j] * v[(j - s + N) % N]; - } - }); - return ev; -} - -int main(int argc, char** argv) { - const unsigned int N = (argc > 1) ? std::stoi(argv[1]) : 32; - // N >= 8 required for the arbitrary signals as defined herein - if (N < 8 || N > INT_MAX) - throw std::invalid_argument("The period of the signal, chosen as input of " - "the program, must be 8 or greater."); - - // Let s be an integer s.t. 0 <= s < N and let - // corr[s] = \sum_{j = 0}^{N-1} sig1[j] sig2[(j - s + N) mod N] - // be the cross-correlation between two real periodic signals sig1 and sig2 - // of period N. This code shows how to calculate corr using Discrete Fourier - // Transforms (DFTs). - // 0 (resp. 1) is returned if naive and DFT-based calculations are (resp. - // are not) within error tolerance of one another. - int return_code = 0; - - // Initialize SYCL queue - sycl::queue Q(sycl::default_selector_v); - std::cout << "Running on: " - << Q.get_device().get_info() - << std::endl; - // Initialize signal and correlation arrays. The arrays must be large enough - // to store the forward and backward domains' data, consisting of N real - // values and (N/2 + 1) complex values, respectively (for the DFT-based - // calculations). Note: 2 * (N / 2 + 1) > N for all N > 0, since - // 2 * (N / 2 + 1) = N + 1 if N is odd - // 2 * (N / 2 + 1) = N + 2 if N is even - // so max(N, 2 * (N / 2 + 1)) == 2 * (N / 2 + 1) - auto sig1 = sycl::malloc_shared(2 * (N / 2 + 1), Q); - auto sig2 = sycl::malloc_shared(2 * (N / 2 + 1), Q); - auto corr = sycl::malloc_shared(2 * (N / 2 + 1), Q); - // Array used for calculating corr without Discrete Fourier Transforms - // for comparison purposes (calculations entirely done in forward domain): - auto naive_corr = sycl::malloc_shared(N, Q); - - // Initialize input signals with artificial "noise" data (random values of - // magnitude much smaller than relevant signal data points) - std::uint32_t seed = (unsigned)time(NULL); // Get RNG seed value - oneapi::mkl::rng::mcg31m1 engine(Q, seed); // Initialize RNG engine - // Set RNG distribution - oneapi::mkl::rng::uniform - rng_distribution(-0.00005f, 0.00005f); - - auto evt1 = oneapi::mkl::rng::generate(rng_distribution, engine, N, sig1); - auto evt2 = oneapi::mkl::rng::generate(rng_distribution, engine, N, sig2); - - // Set the (relevant) signal data as shifted versions of one another - auto evt = Q.single_task<>({evt1, evt2}, [=]() { - sig1[N - N / 4 - 1] = 1.0f; - sig1[N - N / 4] = 1.0f; - sig1[N - N / 4 + 1] = 1.0f; - sig2[N / 4 - 1] = 1.0f; - sig2[N / 4] = 1.0f; - sig2[N / 4 + 1] = 1.0f; - }); - // Calculate L2 norms of both input signals before proceeding (for - // normalization purposes and for the definition of error tolerance) - float *norm_sig1 = sycl::malloc_shared(1, Q); - float *norm_sig2 = sycl::malloc_shared(1, Q); - evt1 = oneapi::mkl::blas::nrm2(Q, N, sig1, 1, norm_sig1, {evt}); - evt2 = oneapi::mkl::blas::nrm2(Q, N, sig2, 1, norm_sig2, {evt}); - // 1) Calculate the cross-correlation naively (for verification purposes); - naive_cross_correlation(Q, N, sig1, sig2, naive_corr, {evt}).wait(); - // 2) Calculate the cross-correlation via Discrete Fourier Transforms (DFTs): - // corr = (1/N) * iDFT(DFT(sig1) * CONJ(DFT(sig2))) - // Initialize DFT descriptor - oneapi::mkl::dft::descriptor desc(N); - // oneMKL DFT descriptors use unit scaling factors by default. Explicitly set - // the non-default scaling factor for the backward ("inverse") DFT: - desc.set_value(oneapi::mkl::dft::config_param::BACKWARD_SCALE, 1.0f / N); - desc.commit(Q); - // Compute in-place forward transforms of both signals: - // sig1 <- DFT(sig1) - evt1 = oneapi::mkl::dft::compute_forward(desc, sig1, {evt1}); - // sig2 <- DFT(sig2) - evt2 = oneapi::mkl::dft::compute_forward(desc, sig2, {evt2}); - // Compute the element-wise multiplication of (complex) coefficients in - // backward domain: - // corr <- sig1 * CONJ(sig2) [component-wise] - evt = oneapi::mkl::vm::mulbyconj( - Q, N / 2 + 1, - reinterpret_cast*>(sig1), - reinterpret_cast*>(sig2), - reinterpret_cast*>(corr), {evt1, evt2}); - // Compute in-place (scaled) backward transform: - // corr <- (1/N) * iDFT(corr) - oneapi::mkl::dft::compute_backward(desc, corr, {evt}).wait(); - - // Error bound for naive calculations: - float max_err_threshold = - 2.0f * std::numeric_limits::epsilon() * norm_sig1[0] * norm_sig2[0]; - // Adding an (empirical) error bound for the DFT-based calculation defined as - // epsilon * O(log(N)) * scaling_factor * nrm2(input data), - // wherein (for the last DFT at play) - // - scaling_factor = 1.0 / N; - // - nrm2(input data) = norm_sig1[0] * norm_sig2[0] * N - // - O(log(N)) ~ 2 * log(N) [arbitrary choice; implementation-dependent behavior] - max_err_threshold += - 2.0f * std::log(static_cast(N)) - * std::numeric_limits::epsilon() * norm_sig1[0] * norm_sig2[0]; - // Verify results by comparing DFT-based and naive calculations to each other, - // and fetch optimal shift maximizing correlation (DFT-based calculation). - float max_err = 0.0f; - float max_corr = corr[0]; - int optimal_shift = 0; - for (size_t s = 0; s < N; s++) { - const float local_err = std::fabs(naive_corr[s] - corr[s]); - if (local_err > max_err) - max_err = local_err; - if (max_err > max_err_threshold) { - std::cerr << "An error was found when verifying the results." << std::endl; - std::cerr << "For shift value s = " << s << ":" << std::endl; - std::cerr << "\tNaive calculation results in " << naive_corr[s] << std::endl; - std::cerr << "\tFourier-based calculation results in " << corr[s] << std::endl; - std::cerr << "The error (" << max_err - << ") exceeds the threshold value of " - << max_err_threshold << std::endl; - return_code = 1; - break; - } - if (corr[s] > max_corr) { - max_corr = corr[s]; - optimal_shift = s; - } - } - // Conclude: - if (return_code == 0) { - // Get average and standard deviation of either signal for normalizing the - // correlation "score" - const float avg_sig1 = sig1[0] / N; - const float avg_sig2 = sig2[0] / N; - const float std_dev_sig1 = - std::sqrt((norm_sig1[0] * norm_sig1[0] - N * avg_sig1 * avg_sig1) / N); - const float std_dev_sig2 = - std::sqrt((norm_sig2[0] * norm_sig2[0] - N * avg_sig2 * avg_sig2) / N); - const float normalized_corr = - (max_corr / N - avg_sig1 * avg_sig2) / (std_dev_sig1 * std_dev_sig2); - std::cout << "Right-shift the second signal " << optimal_shift - << " elements to get a maximum, normalized correlation score of " - << normalized_corr - << " (treating the signals as periodic)." << std::endl; - std::cout << "Max difference between naive and Fourier-based calculations : " - << max_err << " (verification threshold: " << max_err_threshold - << ")." << std::endl; - } - - // Cleanup - sycl::free(sig1, Q); - sycl::free(sig2, Q); - sycl::free(corr, Q); - sycl::free(naive_corr, Q); - sycl::free(norm_sig1, Q); - sycl::free(norm_sig2, Q); - return return_code; -} diff --git a/Libraries/oneMKL/fourier_correlation/fcorr_2d_usm.cpp b/Libraries/oneMKL/fourier_correlation/fcorr_2d_usm.cpp deleted file mode 100644 index 80df329220..0000000000 --- a/Libraries/oneMKL/fourier_correlation/fcorr_2d_usm.cpp +++ /dev/null @@ -1,304 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= -// -// Content: -// This code implements the 2D Fourier correlation algorithm -// using SYCL, oneMKL, and unified shared memory (USM). -// -// ============================================================= - -#include -#include -#include -#include -#include - -template -static bool is_device_accessible(const T* x, const sycl::queue& Q) { - sycl::usm::alloc alloc_type = sycl::get_pointer_type(x, Q.get_context()); - return (alloc_type == sycl::usm::alloc::shared - || alloc_type == sycl::usm::alloc::device); -} - -template -static bool is_host_accessible(const T* x, const sycl::queue& Q) { - sycl::usm::alloc alloc_type = sycl::get_pointer_type(x, Q.get_context()); - return (alloc_type == sycl::usm::alloc::shared - || alloc_type == sycl::usm::alloc::host); -} - -static void -print_image(const float* img, const sycl::queue& Q, - const unsigned& n_rows, const unsigned& n_cols, - const unsigned& col_stride, const std::string& header) { - if (!is_host_accessible(img, Q)) { - throw std::invalid_argument("img must be host-accessible"); - } - std::cout << header << std::endl; - // img must contain (at least) - // ((n_rows - 1) * col_stride + n_cols - 1) float values - for (auto row = 0; row < n_rows; row++) { - for (auto col = 0; col < n_cols; col++) { - std::cout << img[row * col_stride + col] << " "; - } - std::cout << std::endl; - } -} - -static float -calc_frobenius_norm(const float* img, sycl::queue& Q, - const unsigned& n_rows, const unsigned& n_cols, - const unsigned& col_stride) { - if (!is_device_accessible(img, Q)) { - throw std::invalid_argument("img must be device-accessible"); - } - float* temp = sycl::malloc_shared(1, Q); - temp[0] = 0.0f; - Q.submit([&](sycl::handler &cgh) { - auto sumReduction = sycl::reduction(temp, 0.0f, sycl::plus()); - cgh.parallel_for(sycl::range<2>{n_rows, n_cols}, - sumReduction, - [=](sycl::id<2> idx, auto& sum) { - size_t row = idx[0]; - size_t col = idx[1]; - sum += img[row * col_stride + col] * img[row * col_stride + col]; - }); - }).wait(); - const float frobenius_norm = std::sqrt(temp[0]); - sycl::free(temp, Q); - return frobenius_norm; -} - -static sycl::event -naive_cross_correlation(sycl::queue& Q, - const unsigned& n_rows, - const unsigned& n_cols, - const unsigned& col_stride, - const float* u, - const float* v, - float* w, - const std::vector deps = {}) { - // u, v and w must be USM allocations of (at least) - // ((n_rows - 1) * col_stride + n_cols - 1) float values (w must be writable) - if (!is_device_accessible(u, Q) || - !is_device_accessible(v, Q) || - !is_device_accessible(w, Q)) { - throw std::invalid_argument("Image arrays must be device-accessible"); - } - sycl::event ev = Q.parallel_for(sycl::range<2>{n_rows, n_cols}, - [=](sycl::id<2> idx) { - const size_t s = idx[0]; - const size_t p = idx[1]; - const size_t w_idx = s * col_stride + p; - w[w_idx] = 0.0f; - for (size_t j = 0; j < n_rows; j++) { - for (size_t k = 0; k < n_cols; k++) { - w[w_idx] += u[j * col_stride + k] * - v[((j - s + n_rows) % n_rows) * col_stride - + ((k - p + n_cols) % n_cols)]; - } - } - }); - return ev; -} - -int main(int argc, char **argv) { - int temp = (argc <= 1) ? 8 : std::stoi(argv[1]); - // n_rows >= 6 required for the arbitrary signals as defined herein - if (temp < 6) - throw std::invalid_argument("The number of rows of the images, chosen as " - "first input of the program, must be 6 or greater."); - const unsigned n_rows = temp; - temp = (argc <= 2) ? 8 : std::stoi(argv[2]); - // n_cols >= 7 required for the arbitrary signals as defined herein - if (temp < 7) - throw std::invalid_argument("The number of columns of the images, chosen as " - "second input of the program, must be 7 or greater."); - const unsigned n_cols = temp; - const unsigned num_elem = n_rows * n_cols; - - // Let s and p be integer s.t. 0 <= s < n_rows, 0 <= p < n_cols, and let - // corr(s, p) = - // \sum_{j = 0}^{n_rows - 1} \sum_{k = 0}^{n_cols - 1} \ - // img1(j, k) * img2((j - s + n_rows) mod n_rows, (k - p + n_cols) mod n_cols) - // be the cross-correlation between two real periodic signals img1 and img2 - // of periods (n_rows, n_cols). This code shows how to calculate corr using - // Discrete Fourier Transforms (DFTs). - // Note: in the above, the notation "x(i, j)" represents the entry of - // multi-index (i, j) within a (real) data sequence "x". If the latter is - // stored in memory in an allocation "x_alloc" using a unit row stride and a - // column stride col_stride (col_stride >= n_cols), we have - // x_alloc[i * col_stride + j] <- "x(i,j)" - - // This program returns 0 (resp. 1) if naive and DFT-based calculations are - // (resp. are not) within error tolerance of one another. - int return_code = 0; - - // Initialize SYCL queue - sycl::queue Q(sycl::default_selector_v); - std::cout << "Running on: " - << Q.get_device().get_info() - << std::endl; - - // Initialize 2D image and correlation arrays. The arrays must be large enough - // to store the forward and backward domains' data, consisting of - // n_rows * n_cols real values and n_rows * (n_cols / 2 + 1) complex values, - // respectively (for the DFT-based calculations). - // Note: 2 * (n_cols / 2 + 1) > n_cols for all n_cols > 0, so - // max(n_rows * n_cols, - // n_rows * (n_cols / 2 + 1) * 2) == n_rows * (n_cols / 2 + 1) * 2 - // since n_rows > 0 - auto img1 = sycl::malloc_shared(n_rows * (n_cols / 2 + 1) * 2, Q); - auto img2 = sycl::malloc_shared(n_rows * (n_cols / 2 + 1) * 2, Q); - auto corr = sycl::malloc_shared(n_rows * (n_cols / 2 + 1) * 2, Q); - // For in-place calculations, the address of the 0th element in every row must - // also be identical in forward and backward domains so we use - const unsigned col_stride_fwd_domain = 2 * (n_cols / 2 + 1); - // in forward (real) domain. - // Note: col_stride_fwd_domain / 2 is to be used in backward (complex) - // domain since complex values consist of 2 contiguous real values. - - // Initialize array for calculating corr without Discrete Fourier Transforms - // (for comparison purposes). The same column stride as for DFT-based - // calculations is used to satisfy the requirements of naive_cross_correlation: - auto naive_corr = sycl::malloc_shared(n_rows * (n_cols / 2 + 1) * 2, Q); - - // Set the relevant image data as shifted versions of one another - auto evt = Q.parallel_for(sycl::range<2>{n_rows, n_cols}, - [=](sycl::id<2> idx) { - size_t row = idx[0]; - size_t col = idx[1]; - img1[row * col_stride_fwd_domain + col] = 0.0f; - img2[row * col_stride_fwd_domain + col] = 0.0f; - }); - Q.single_task<>({evt}, [=]() { - // Set a box of unit elements in multi-indices (4-5, 5-6) for the first - // image - img1[4 * col_stride_fwd_domain + 5] = 1.0f; - img1[4 * col_stride_fwd_domain + 6] = 1.0f; - img1[5 * col_stride_fwd_domain + 5] = 1.0f; - img1[5 * col_stride_fwd_domain + 6] = 1.0f; - // Set a box of unit elements in multi-indices (1-2, 1-2) for the second - // image - img2[1 * col_stride_fwd_domain + 1] = 1.0f; - img2[1 * col_stride_fwd_domain + 2] = 1.0f; - img2[2 * col_stride_fwd_domain + 1] = 1.0f; - img2[2 * col_stride_fwd_domain + 2] = 1.0f; - }).wait(); - - print_image(img1, Q, n_rows, n_cols, col_stride_fwd_domain, "First image:"); - print_image(img2, Q, n_rows, n_cols, col_stride_fwd_domain, "Second image:"); - // Calculate Frobenius norms of both input images before proceeding (for - // normalization purposes and for the definition of error tolerance) - const float norm_img1 = - calc_frobenius_norm(img1, Q, n_rows, n_cols, col_stride_fwd_domain); - const float norm_img2 = - calc_frobenius_norm(img2, Q, n_rows, n_cols, col_stride_fwd_domain); - // 1) Calculate the cross-correlation naively (for verification purposes); - naive_cross_correlation(Q, n_rows, n_cols, col_stride_fwd_domain, - img1, img2, naive_corr).wait(); - // 2) Calculate the cross-correlation via Discrete Fourier Transforms (DFTs): - // corr = (1/num_elem) * iDFT(DFT(sig1) * CONJ(DFT(sig2))) - // Initialize DFT descriptor - oneapi::mkl::dft::descriptor - desc({n_rows, n_cols}); - // oneMKL DFT descriptors use unit scaling factors by default. Explicitly set - // the non-default scaling factor for the backward ("inverse") DFT: - desc.set_value(oneapi::mkl::dft::config_param::BACKWARD_SCALE, - 1.0f / num_elem); - desc.commit(Q); - // --> desc operates in-place with the strides used herein by default. - - // Compute in-place forward transforms of both signals: - // img1 <- DFT(img1) - auto evt1 = oneapi::mkl::dft::compute_forward(desc, img1); - // img2 <- DFT(img2) - auto evt2 = oneapi::mkl::dft::compute_forward(desc, img2); - // Compute the element-wise multiplication of (complex) coefficients in - // backward domain: - // corr <- sig1 * CONJ(sig2) [component-wise] - evt = oneapi::mkl::vm::mulbyconj( - Q, n_rows * (n_cols / 2 + 1), - reinterpret_cast*>(img1), - reinterpret_cast*>(img2), - reinterpret_cast*>(corr), - {evt1, evt2}); - // Compute in-place (scaled) backward transform: - // corr <- (1 / num_elem) * iDFT(corr) - oneapi::mkl::dft::compute_backward(desc, corr, {evt}).wait(); - - // Error bound for naive calculations: - float max_err_threshold = - 2.0f * std::numeric_limits::epsilon() * norm_img1 * norm_img2; - // Adding an (empirical) error bound for the DFT-based calculation defined as - // epsilon * O(log(num_elem)) * scaling_factor * nrm2(input data), - // wherein (for the last DFT at play) - // - scaling_factor = 1.0 / num_elem; - // - nrm2(input data) = norm_sig1[0] * norm_sig2[0] * num_elem - // - O(log(num_elem)) ~ 2 * log(num_elem) - // [arbitrary choice; implementation-dependent behavior] - max_err_threshold += - 2.0f * std::log(static_cast(num_elem)) - * std::numeric_limits::epsilon() * norm_img1 * norm_img2; - // Verify results by comparing DFT-based and naive calculations to each other, - // and fetch optimal shift maximizing correlation (DFT-based calculation). - float max_err = 0.0f; - float max_corr = corr[0]; - std::pair optimal_shift(0, 0); - for (size_t s = 0; s < n_rows && return_code == 0; s++) { - for (size_t p = 0; p < n_cols && return_code == 0; p++) { - const float naive_val = naive_corr[s * col_stride_fwd_domain + p]; - const float dft_val = corr[s * col_stride_fwd_domain + p]; - const float local_err = std::fabs(naive_val - dft_val); - if (local_err > max_err) - max_err = local_err; - if (max_err > max_err_threshold) { - std::cerr << "An error was found when verifying the results." << std::endl; - std::cerr << "For shift value (s, p) = (" << s << ", " << p << "):" << std::endl; - std::cerr << "\tNaive calculation results in " << naive_val << std::endl; - std::cerr << "\tFourier-based calculation results in " << dft_val << std::endl; - std::cerr << "The error (" << max_err - << ") exceeds the threshold value of " - << max_err_threshold << std::endl; - return_code = 1; - } - if (dft_val > max_corr) { - max_corr = dft_val; - optimal_shift.first = s; - optimal_shift.second = p; - } - } - } - // Conclude: - if (return_code == 0) { - // Get average and standard deviation of either signal for normalizing the - // correlation "score" - const float avg_sig1 = img1[0] / num_elem; - const float avg_sig2 = img2[0] / num_elem; - const float std_dev_sig1 = - std::sqrt((norm_img1 * norm_img1 - num_elem * avg_sig1 * avg_sig1) / num_elem); - const float std_dev_sig2 = - std::sqrt((norm_img2 * norm_img2 - num_elem * avg_sig2 * avg_sig2) / num_elem); - const float normalized_corr = - (max_corr / num_elem - avg_sig1 * avg_sig2) / (std_dev_sig1 * std_dev_sig2); - std::cout << "Shift the second signal by translation vector (" - << optimal_shift.first << ", " << optimal_shift.second - << ") to get a maximum, normalized correlation score of " - << normalized_corr - << " (treating the signals as periodic along both dimensions)." - << std::endl; - std::cout << "Max difference between naive and Fourier-based calculations : " - << max_err << " (verification threshold: " << max_err_threshold - << ")." << std::endl; - } - // Cleanup - sycl::free(img1, Q); - sycl::free(img2, Q); - sycl::free(corr, Q); - sycl::free(naive_corr, Q); - return return_code; -} diff --git a/Libraries/oneMKL/fourier_correlation/makefile b/Libraries/oneMKL/fourier_correlation/makefile deleted file mode 100644 index ef2ffc663c..0000000000 --- a/Libraries/oneMKL/fourier_correlation/makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Makefile for NMAKE - -default: run_all - -all: run_all - -run_all: fcorr_1d_buff.exe fcorr_1d_usm.exe fcorr_2d_usm.exe - .\fcorr_1d_buff 1024 - .\fcorr_1d_usm 1024 - .\fcorr_2d_usm - -DPCPP_OPTS=-DMKL_ILP64 -I"%MKLROOT%\include" /Qmkl /Qmkl-sycl-impl="blas,dft,rng,vm" OpenCL.lib /EHsc - -fcorr_1d_buff.exe: fcorr_1d_buffers.cpp - icx-cl -fsycl fcorr_1d_buffers.cpp /Fefcorr_1d_buff.exe $(DPCPP_OPTS) - -fcorr_1d_usm.exe: fcorr_1d_usm.cpp - icx-cl -fsycl fcorr_1d_usm.cpp /Fefcorr_1d_usm.exe $(DPCPP_OPTS) - -fcorr_2d_usm.exe: fcorr_2d_usm.cpp - icx-cl -fsycl fcorr_2d_usm.cpp /Fefcorr_2d_usm.exe $(DPCPP_OPTS) - -clean: - del /q fcorr_1d_buff.exe fcorr_1d_usm.exe fcorr_2d_usm.exe - del /q fcorr_1d_buff.exp fcorr_1d_usm.exp fcorr_2d_usm.exp - -pseudo: run_all clean all diff --git a/Libraries/oneMKL/fourier_correlation/sample.json b/Libraries/oneMKL/fourier_correlation/sample.json deleted file mode 100644 index ecf242c460..0000000000 --- a/Libraries/oneMKL/fourier_correlation/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "69F6B0A1-3046-467F-B4A7-E61F636BC5BF", - "name": "Fourier Correlation", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Compute Fourier correlation with oneAPI", - "toolchain": [ "dpcpp" ], - "dependencies": [ "oneMKL" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "fourier_correlation", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "fourier_correlation", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/fourier_correlation/third-party-programs.txt b/Libraries/oneMKL/fourier_correlation/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/fourier_correlation/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/guided_american_options_SYCLmigration/License.txt b/Libraries/oneMKL/guided_american_options_SYCLmigration/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/guided_american_options_SYCLmigration/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/License.txt b/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/guided_simpleCUBLAS_LU_SYCLMigration/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/matrix_mul_mkl/GNUmakefile b/Libraries/oneMKL/matrix_mul_mkl/GNUmakefile deleted file mode 100644 index d113fb822e..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/GNUmakefile +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile for GNU Make - -default: run - -all: matrix_mul_mkl - -run: matrix_mul_mkl - ./matrix_mul_mkl single - ./matrix_mul_mkl double - -INCLUDE_COMMON=../../../common -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl=blas - -DPCPP_OPTS = -O2 $(MKL_COPTS) - -matrix_mul_mkl: matrix_mul_mkl.cpp - icpx -fsycl -I$(INCLUDE_COMMON) $< -o $@ $(DPCPP_OPTS) - -clean: - -rm -f matrix_mul_mkl - -.PHONY: clean run all diff --git a/Libraries/oneMKL/matrix_mul_mkl/License.txt b/Libraries/oneMKL/matrix_mul_mkl/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/matrix_mul_mkl/README.md b/Libraries/oneMKL/matrix_mul_mkl/README.md deleted file mode 100644 index 43fb14e044..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# `Matrix Multiplication with oneMKL` Sample - -Matrix Multiplication with Intel® oneAPI Math Kernel Library (oneMKL) shows how to use the oneMKL optimized matrix multiplication routines, and provides a simple benchmark. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use the oneMKL matrix multiplication functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -Matrix Multiplication uses oneMKL to multiply two large matrices and measure device performance. - -This sample performs its computations on the default SYCL* device. You can set -the `ONEAPI_DEVICE_SELECTOR` environment variable to `"*:cpu"` or `"*:gpu"` -to select the device to use. -To find more information about the variable follow the link: -[ONEAPI_DEVICE_SELECTOR](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector). - -## Key Implementation Details - -The oneMKL `blas::gemm` routine performs a matrix multiplication operation with optional scaling and updating behavior. oneMKL BLAS routines support both row-major and column-major matrix layouts; this sample uses the default column-major layout, the traditional choice for BLAS. - -This sample provides a simple benchmark to test `gemm` performance on a SYCL device, and illustrates several best practices: - - Perform a warmup run before timing, to allow oneMKL to initialize and prepare GEMM kernels for execution. - - Pad matrix dimensions if needed to ensure data is well-aligned. - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Matrix Multiplication with oneMKL Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux Sudo: . /opt/intel/oneapi/setvars.sh -> -> Linux User: . ~/intel/oneapi/setvars.sh -> -> Windows: C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat -> ->For more information on environment variables, see Use the setvars Script for [Linux or macOS](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html), or [Windows](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build and run the sample. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -## Running the Matrix Multiplication with oneMKL Sample - -### Example of Output -Example output from this sample: - -``` -./matrix_mul_mkl single -oneMKL DPC++ GEMM benchmark ---------------------------- -Device: Intel(R) Iris(R) Pro Graphics 580 -Core/EU count: 72 -Maximum clock frequency: 950 MHz - -Benchmarking (4096 x 4096) x (4096 x 4096) matrix multiplication, single precision - -> Initializing data... - -> Warmup... - -> Timing... - -Average performance: ... - -./matrix_mul_mkl double -oneMKL DPC++ GEMM benchmark ---------------------------- -Device: Intel(R) Iris(R) Pro Graphics 580 -Core/EU count: 72 -Maximum clock frequency: 950 MHz - -Benchmarking (4096 x 4096) x (4096 x 4096) matrix multiplication, double precision - -> Initializing data... - -> Warmup... - -> Timing... - -Average performance: ... -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/matrix_mul_mkl/makefile b/Libraries/oneMKL/matrix_mul_mkl/makefile deleted file mode 100644 index 88c2c279d9..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Makefile for NMAKE - -default: run - -all: matrix_mul_mkl.exe - -run: matrix_mul_mkl.exe - .\matrix_mul_mkl.exe single - .\matrix_mul_mkl.exe double - -DPCPP_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl=blas /EHsc -fsycl-device-code-split=per_kernel OpenCL.lib - -matrix_mul_mkl.exe: matrix_mul_mkl.cpp - icx-cl -fsycl matrix_mul_mkl.cpp /Fematrix_mul_mkl.exe $(DPCPP_OPTS) - -clean: - del /q matrix_mul_mkl.exe matrix_mul_mkl.exp matrix_mul_mkl.lib - -pseudo: clean run all diff --git a/Libraries/oneMKL/matrix_mul_mkl/matrix_mul_mkl.cpp b/Libraries/oneMKL/matrix_mul_mkl/matrix_mul_mkl.cpp deleted file mode 100644 index 427505b7fa..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/matrix_mul_mkl.cpp +++ /dev/null @@ -1,240 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= -// -// Contents: -// A simple matrix multiplication benchmark, using the oneAPI Math Kernel -// Library (oneMKL). -// - -#include -#include -#include -#include -#include -#include -#include - -#include "utilities.hpp" - -using namespace sycl; - -template -static -bool test(queue &Q, int M, int N, int K) -{ - std::cout << "\nBenchmarking (" << M << " x " << K << ") x (" << K << " x " << N << ") matrix multiplication, " << type_string() << "\n";; - - std::cout << " -> Initializing data...\n"; - - /* Allocate A/B/C matrices */ - int lda = nice_ld(M); - int ldb = nice_ld(K); - int ldc = nice_ld(M); - - auto A = malloc_device(lda * K, Q); - auto B = malloc_device(ldb * N, Q); - auto C = malloc_device(ldc * N, Q); - - constexpr int rd_size = 1048576; - std::vector host_vector(rd_size); - auto host_data = host_vector.data(); - - /* Measure time for a given number of GEMM calls */ - auto time_gemms = [=, &Q](int runs) -> double { - using namespace oneapi::mkl; - using namespace std::chrono; - auto start = steady_clock::now(); - for (int i = 0; i < runs; i++) - blas::gemm(Q, transpose::N, transpose::N, M, N, K, 1, A, lda, B, ldb, 0, C, ldc); - Q.wait_and_throw(); - auto end = steady_clock::now(); - return duration(end - start).count(); - }; - - /* Fill A/B with all ones to verify correctness */ - generate_ones(rd_size, host_data); - replicate_data(Q, A, lda * K, host_data, rd_size); - replicate_data(Q, B, ldb * N, host_data, rd_size); - - /* Verify that the leading entries of C are correct */ - std::cout << " -> Verification..."; - (void) time_gemms(1); - size_t elems = std::min(ldc * N, rd_size); - Q.copy(C, host_data, elems).wait(); - bool ok = true; - int linear_id = 0; - for (size_t j = 0; j < N; j++) { - for (size_t i = 0; i < M; i++) { - linear_id = j*ldc + i; - if (linear_id >= elems) break; - if (host_data[linear_id] != T(K)) { - ok = false; - } - } - if (linear_id >= elems) break; - } - - std::cout << "gemm " << (ok ? " passes." : " FAILS!") << " for type: " << type_string() << "\n"; - if (!ok) { return false; } - - /* Fill A/B with random data */ - generate_random_data(rd_size, host_data); - replicate_data(Q, A, lda * K, host_data, rd_size); - replicate_data(Q, B, ldb * N, host_data, rd_size); - - /* Do a warmup call with random data to initialize MKL and ensure kernels are JIT'ed if needed */ - std::cout << " -> Warmup...\n"; - (void) time_gemms(1); - - /* Time one GEMM call, and estimate how many calls will be required to keep the - * GPU busy for 1s. */ - auto tare = time_gemms(1); - int ncalls = std::max(4, std::min(1000, int(1. / tare))); - - /* Time that many GEMMs, subtracting the first call time to remove host overhead. - * This gives a better idea of device performance. */ - std::cout << " -> Timing...\n"; - auto time = time_gemms(ncalls + 1) - tare; - auto avg = time / ncalls; - - /* Calculate and display performance */ - auto op_count = double(M) * double(N) * double(K) * 2; - auto flops = op_count / avg; - - flops *= 1e-9; - char unit = 'G'; - if (flops >= 1000.) { - flops *= 1e-3; - unit = 'T'; - } - if (flops >= 1000.) { - flops *= 1e-3; - unit = 'P'; - } - - std::cout << "\nAverage performance: " << flops << unit << 'F' << "\n"; - - /* Free data */ - free(C, Q); - free(B, Q); - free(A, Q); - - return true; -} - -static -void usage(const char *pname) -{ - std::cerr << "Usage:\n" - << " " << pname << " [type] N benchmark (NxN) x (NxN) square matrix multiplication (default: N = 4096)\n" - << " " << pname << " [type] M N K benchmark (MxK) x (KxN) square matrix multiplication\n" - << "\n" - << "The optional [type] selects the data type:\n" - << " double [default]\n" - << " single\n" - << " half\n" - << " all (runs all above)\n" - << "\n" - << "This benchmark uses the default DPC++ device, which can be controlled using\n" - << " the ONEAPI_DEVICE_SELECTOR environment variable\n"; - std::exit(1); -} - -static -bool device_has_fp64(sycl::device const& D) { - return (D.get_info().size() != 0); -} - -static -void device_info(sycl::device const& D) { - std::cout << "oneMKL DPC++ GEMM benchmark\n" - << "---------------------------\n" - << "Platform: " << D.get_platform().get_info() << "\n" - << "Device: " << D.get_info() << "\n" - << "Driver_version: " << D.get_info() << "\n" - << "Core/EU count: " << D.get_info() << "\n" - << "Maximum clock frequency: " << D.get_info() << " MHz" << "\n" - << "FP64 capability: " << (device_has_fp64(D) ? "yes" : "no") << "\n" - << "\n" - ; -} - -int main(int argc, char **argv) -{ - auto pname = argv[0]; - int M = 4096, N = 4096, K = 4096; - std::string type = "none"; - - if (argc <= 1) - usage(pname); - - if (argc > 1 && std::isalpha(argv[1][0])) { - type = argv[1]; - argc--; argv++; - } - - if (argc > 1) M = N = K = std::atoi(argv[1]); - - if (argc > 3) { - N = std::atoi(argv[2]); - K = std::atoi(argv[3]); - } - - if (M <= 0 || N <= 0 || K <= 0) - usage(pname); - - bool g_success = true; - try { - device D(default_selector_v); - device_info(D); - - context C(D); - queue Q(C, D); - - if ("none" == type) - std::string type = device_has_fp64(D) ? "double" : "float"; - - if (type == "double") { - if (device_has_fp64(D)) - test(Q, M, N, K); - else { - std::cout << "no FP64 capability on given SYCL device and type == \"double\""; - return 1; - } - } - else if (type == "single" || type == "float") - g_success = g_success && test(Q, M, N, K); - else if (type == "half") - g_success = g_success && test(Q, M, N, K); - else if (type == "all") { - type = "half"; - g_success = g_success && test(Q, M, N, K); - - type = "float"; - g_success = g_success && test(Q, M, N, K); - - if (device_has_fp64(D)) { - type = "double"; - g_success = g_success && test(Q, M, N, K); - } - } else { - type = "none"; - usage(pname); - } - } catch (sycl::exception const& e) { - std::cerr << "SYCL exception: " << e.what() << "\n"; - std::cerr << " while performing GEMM for" - << " M=" << M - << ", N=" << N - << ", K=" << K - << ", type `" << type << "`" - << "\n"; - return 139; - } - - return g_success ? 0 : 1; -} - diff --git a/Libraries/oneMKL/matrix_mul_mkl/sample.json b/Libraries/oneMKL/matrix_mul_mkl/sample.json deleted file mode 100644 index fa6a75fda9..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/sample.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "guid": "3FF02594-2431-4C39-A71B-FA54D34D6A97", - "name": "Matrix Multiply MKL", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Accelerate Matrix Multiplication with Intel® oneMKL", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "gpuRequired": ["gen9","pvc"], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "matrix_mul_mkl", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "matrix_mul_mkl", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/matrix_mul_mkl/third-party-programs.txt b/Libraries/oneMKL/matrix_mul_mkl/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/matrix_mul_mkl/utilities.hpp b/Libraries/oneMKL/matrix_mul_mkl/utilities.hpp deleted file mode 100644 index 91bf034e19..0000000000 --- a/Libraries/oneMKL/matrix_mul_mkl/utilities.hpp +++ /dev/null @@ -1,55 +0,0 @@ -//============================================================== -// Copyright © 2023 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#include -#include - -template const char *type_string() { return "unknown type"; } -template <> const char *type_string() { return "half precision"; } -template <> const char *type_string() { return "single precision"; } -template <> const char *type_string() { return "double precision"; } - -/* Choose inter-column padding for optimal performance */ -template -int nice_ld(int x) -{ - x = std::max(x, 1); - x *= sizeof(T); - x = (x + 511) & ~511; - x += 256; - x /= sizeof(T); - return x; -} - -template -void generate_ones(size_t elems, T *v) -{ -#pragma omp parallel for - for (size_t i = 0; i < elems; i++) - v[i] = T(1); -} - -/* Random number generation helpers */ -template -void generate_random_data(size_t elems, T *v) -{ -#pragma omp parallel for - for (size_t i = 0; i < elems; i++) - v[i] = double(std::rand()) / RAND_MAX; -} - -template -void replicate_data(sycl::queue &Q, T *dst, size_t dst_elems, const T *src, size_t src_elems) -{ - while (dst_elems > 0) { - auto copy_elems = std::min(dst_elems, src_elems); - Q.copy(src, dst, copy_elems); - dst += copy_elems; - dst_elems -= copy_elems; - } - Q.wait(); -} - diff --git a/Libraries/oneMKL/monte_carlo_european_opt/GNUmakefile b/Libraries/oneMKL/monte_carlo_european_opt/GNUmakefile deleted file mode 100644 index d40957be49..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/GNUmakefile +++ /dev/null @@ -1,31 +0,0 @@ -all: montecarlo - -# setting non-default generator -generator ?= mcg59 - -ifeq ($(generator), mrg) - GENERATOR = -DUSE_MRG -endif - -ifeq ($(generator), philox) - GENERATOR = -DUSE_PHILOX -endif - -ifneq ($(generator), $(filter $(generator),mrg philox mcg59)) - $(error "You use unknown generator. Please, use mrg philox or mcg59 (default)") -endif - -# setting initial random number generation on host -init_on_host ?= 0 - -MKL_COPTS = -DMKL_ILP64 $(GENERATOR) -qmkl -qmkl-sycl-impl=rng -Wall -Wformat-security -Werror=format-security - -DPCPP_OPTS = $(MKL_COPTS) -fsycl -DINIT_ON_HOST=$(init_on_host) - -montecarlo: src/montecarlo_main.cpp - icpx $< -o $@ $(DPCPP_OPTS) - -clean: - -rm -f montecarlo - -.PHONY: clean all diff --git a/Libraries/oneMKL/monte_carlo_european_opt/License.txt b/Libraries/oneMKL/monte_carlo_european_opt/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/monte_carlo_european_opt/README.md b/Libraries/oneMKL/monte_carlo_european_opt/README.md deleted file mode 100644 index e866a1512a..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# `Monte Carlo European Options` Sample - -Monte Carlo European Options shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) -random number generation (RNG) functionality to compute European option prices. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use the oneMKL random number generation functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, -see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -This sample uses a Monte Carlo (randomized) method to estimate European call and put option values -based on a stochastic stock price model. A large number of possible implementations of the stock -price over time are generated, and an estimation of the call and put options is made by averaging -their values in each realization. - -This sample performs its computations on the default SYCL* device. You can set -the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - -This article explains in detail how oneMKL random number generators can be used -for parallel computation of European options pricing, based on Monte-Carlo method: -https://www.intel.com/content/www/us/en/docs/onemkl/cookbook/current/monte-carlo-simulating-european-options-pricing.html. - -## Key Implementation Details - -This sample illustrates how to create an RNG engine object (the source of pseudo-randomness), -a distribution object (specifying the desired probability distribution), and finally generate -the random numbers themselves. Random number generation can be done from the host, -storing the results in a SYCL-compliant buffer or USM pointer, or directly in a kernel. - -In this sample, the MCG59 generator is used by default, and a gaussian distribution -is the basis for the Monte Carlo simulation. oneMKL provides many other generators -and distributions to suit a range of applications. After generating the random number -input for the simulation, prices are calculated and then averaged using reduction functions. - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Monte Carlo European Options Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build the sample. Then run the sample calling generated execution file. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample programs. `nmake clean` removes temporary files. - -> **Warning**: On Windows, static linking with oneMKL currently takes a very long time, due to a known compiler issue. This will be addressed in an upcoming release. - -#### Build a sample using others generators -To use the MRG32k3a generator or the Philox4x32x10 generator use `generator=mrg` -or `generator=philox` correspondingly when building the sample, e.g. -``` -make generator=mrg -``` -for Linux* system or - -``` -nmake generator=mrg -``` - -for Windows* System. - -#### Build a sample using Random Number Generation on Host -To have random number generation on host to initialize data use -`init_on_host=1`, e.g. -``` -make init_on_host=1 -``` -for Linux* system or - -``` -nmake init_on_host=1 -``` - -for Windows* System. - -## Running the Monte Carlo European Options Sample -If everything is working correctly, the program will run the Monte Carlo simulation. -After the simulation, results will be checked against the known true values -given by the Black-Scholes formula, and the absolute error is output. - -Example of output: -``` -$ ./montecarlo - -MonteCarlo European Option Pricing in Double precision -Pricing 384000 Options with Path Length = 262144, sycl::vec size = 8, Options Per Work Item = 4 and Iterations = 5 -Completed in 67.6374 seconds. Options per second = 22709.3 -Running quality test... -L1_Norm = 0.000480579 -Average RESERVE = 12.9099 -Max Error = 0.123343 -TEST PASSED! - -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/monte_carlo_european_opt/makefile b/Libraries/oneMKL/monte_carlo_european_opt/makefile deleted file mode 100644 index a6feaefa7a..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/makefile +++ /dev/null @@ -1,23 +0,0 @@ -all: montecarlo - -!if "$(generator)" == "mrg" - GENERATOR=/DUSE_MRG -!endif - -!if "$(generator)" == "philox" - GENERATOR=/DUSE_PHILOX -!endif - -!if "$(init_on_host)" == "1" - INIT_ON_HOST=/DINIT_ON_HOST=1 -!endif - -DPCPP_OPTS=/I"$(MKLROOT)\include" /DMKL_ILP64 $(GENERATOR) /EHsc -fsycl $(INIT_ON_HOST) /Qmkl /Qmkl-sycl-impl=rng OpenCL.lib - -montecarlo: src/montecarlo_main.cpp - icx src/montecarlo_main.cpp /omontecarlo.exe $(DPCPP_OPTS) - -clean: - del /q montecarlo.exe - -pseudo: clean all diff --git a/Libraries/oneMKL/monte_carlo_european_opt/sample.json b/Libraries/oneMKL/monte_carlo_european_opt/sample.json deleted file mode 100644 index 3a59f7e496..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/sample.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "guid": "C7FEBFF7-9067-456E-BE79-98CE22AE3B6B", - "name": "Monte Carlo European Opt", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Monte Carlo Simulation of European Options pricing with Intel® oneMKL random number generators", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "gpuRequired": ["gen9","pvc"], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "monte_carlo_european_opt", - "steps": [ - "make clean", - "make && ./montecarlo" - ] - } - ], - "windows": [ - { - "id": "monte_carlo_european_opt", - "steps": [ - "nmake clean", - "nmake && montecarlo.exe" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo.hpp b/Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo.hpp deleted file mode 100644 index 7ae692d734..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo.hpp +++ /dev/null @@ -1,100 +0,0 @@ -//============================================================== -// Copyright © 2022 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#pragma once - -#define _USE_MATH_DEFINES - -#include -#include -#include -#include - -#ifndef ITEMS_PER_WORK_ITEM -#define ITEMS_PER_WORK_ITEM 4 -#endif - -#ifndef VEC_SIZE -#define VEC_SIZE 8 -#endif - -//Should be > 1 -constexpr int num_options = 384000; -//Should be > 16 -constexpr int path_length = 262144; -//Test iterations -constexpr int num_iterations = 5; - -constexpr float risk_free = 0.06f; -constexpr float volatility = 0.10f; - -constexpr float RLog2E = -risk_free * M_LOG2E; -constexpr float MuLog2E = M_LOG2E * (risk_free - 0.5 * volatility * volatility); -constexpr float VLog2E = M_LOG2E * volatility; - -template -void check(const MonteCarlo_vector& h_CallResult, const MonteCarlo_vector& h_CallConfidence, -const MonteCarlo_vector& h_StockPrice, const MonteCarlo_vector& h_OptionStrike, const MonteCarlo_vector& h_OptionYears) -{ - using DataType = typename MonteCarlo_vector::value_type; - std::vector h_CallResultRef(num_options); - - auto BlackScholesRefImpl = []( - DataType Sf, //Stock price - DataType Xf, //Option strike - DataType Tf //Option years - ) { - // BSM Formula: https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/ - // N(d)=1/2 + 1/2*ERF(d/sqrt(2)), https://software.intel.com/en-us/node/531898 - DataType S = Sf, L = Xf, t = Tf, r = risk_free, sigma = volatility; - DataType N_d1 = 1. / 2. + 1. / 2. * std::erf(((std::log(S / L) + (r + 0.5 * sigma * sigma) * t) / (sigma * std::sqrt(t))) / std::sqrt(2.)); - DataType N_d2 = 1. / 2. + 1. / 2. * std::erf(((std::log(S / L) + (r - 0.5 * sigma * sigma) * t) / (sigma * std::sqrt(t))) / std::sqrt(2.)); - return S * N_d1 - L * std::exp(-r * t) * N_d2; - }; - - for (int opt = 0; opt < num_options; opt++) - { - h_CallResultRef[opt] = BlackScholesRefImpl(h_StockPrice[opt], h_OptionStrike[opt], h_OptionYears[opt]); - } - - std::cout << "Running quality test..." << std::endl; - - DataType sum_delta = 0.0, - sum_ref = 0.0, - max_delta = 0.0, - sum_reserve = 0.0; - - for (int opt = 0; opt < num_options; opt++) - { - DataType ref = h_CallResultRef[opt]; - DataType delta = std::fabs(h_CallResultRef[opt] - h_CallResult[opt]); - if (delta > max_delta) - { - max_delta = delta; - } - sum_delta += delta; - sum_ref += std::fabs(ref); - if (delta > 1e-6) - { - sum_reserve += h_CallConfidence[opt] / delta; - } - max_delta = std::max(delta, max_delta); - - } - sum_reserve /= static_cast(num_options); - DataType L1_norm = sum_delta / sum_ref; - - std::cout << "L1_Norm = "<< L1_norm << std::endl; - std::cout << "Average RESERVE = "<< sum_reserve << std::endl; - std::cout << "Max Error = "<< max_delta << std::endl; - if(sum_reserve > 1.0f) { - std::cout << "TEST PASSED" << std::endl; - } - else{ - std::cout << "TEST FAILED" << std::endl; - exit(1); - } -} diff --git a/Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo_main.cpp b/Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo_main.cpp deleted file mode 100644 index 281577dca2..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/src/montecarlo_main.cpp +++ /dev/null @@ -1,202 +0,0 @@ -//============================================================== -// Copyright © 2022 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#include -#include - -#include - -#include -#include -#include - -#include "montecarlo.hpp" -#include "timer.hpp" - -template -class k_MonteCarlo; // can be useful for profiling -template -class k_initialize_state; // can be useful for profiling - -template -void run() -{ - try { - std::cout << "MonteCarlo European Option Pricing in " << - (std::is_same_v ? "Double" : "Single") << - " precision using " << -#if USE_PHILOX - "PHILOX4x32x10" << -#elif USE_MRG - "MRG32k3a" << -#else - "MCG59" << -#endif - " generator." << - std::endl; - - std::cout << - "Pricing " << num_options << - " Options with Path Length = " << path_length << - ", sycl::vec size = " << VEC_SIZE << - ", Options Per Work Item = " << ITEMS_PER_WORK_ITEM << - " and Iterations = " << num_iterations << - std::endl; - - sycl::queue my_queue; - sycl::usm_allocator alloc(my_queue); - std::vector h_call_result(num_options, alloc); - std::vector h_call_confidence(num_options, alloc); - std::vector h_stock_price(num_options, alloc); - std::vector h_option_strike(num_options, alloc); - std::vector h_option_years(num_options, alloc); - DataType* h_call_result_ptr = h_call_result.data(); - DataType* h_call_confidence_ptr = h_call_confidence.data(); - DataType* h_stock_price_ptr = h_stock_price.data(); - DataType* h_option_strike_ptr = h_option_strike.data(); - DataType* h_option_years_ptr = h_option_years.data(); - - // calculate the number of blocks - constexpr DataType fpath_lengthN = static_cast(path_length); - constexpr DataType stddev_denom = 1.0 / (fpath_lengthN * (fpath_lengthN - 1.0)); - DataType confidence_denom = 1.96 / std::sqrt(fpath_lengthN); - - constexpr int rand_seed = 777; - constexpr std::size_t local_size = 256; - const std::size_t global_size = (num_options * local_size) / ITEMS_PER_WORK_ITEM; // It requires num_options be divisible by ITEMS_PER_WORK_ITEM - const int block_n = path_length / (local_size * VEC_SIZE); - - timer tt{}; - double total_time = 0.0; - - namespace mkl_rng = oneapi::mkl::rng; -#if USE_PHILOX - using EngineTypeHost = mkl_rng::philox4x32x10; - using EngineTypeDevice = mkl_rng::device::philox4x32x10; -#elif USE_MRG - using EngineTypeHost = mkl_rng::mrg32k3a; - using EngineTypeDevice = mkl_rng::device::mrg32k3a; -#else - using EngineTypeHost = mkl_rng::mcg59; - using EngineTypeDevice = mkl_rng::device::mcg59; -#endif - - EngineTypeHost engine( -#if !INIT_ON_HOST - my_queue, -#else - sycl::queue{sycl::cpu_selector_v}, -#endif - rand_seed); // random number generator object - - auto rng_event_1 = mkl_rng::generate(mkl_rng::uniform(5.0, 50.0), engine, num_options, h_stock_price_ptr); - auto rng_event_2 = mkl_rng::generate(mkl_rng::uniform(10.0, 25.0), engine, num_options, h_option_strike_ptr); - auto rng_event_3 = mkl_rng::generate(mkl_rng::uniform(1.0, 5.0), engine, num_options, h_option_years_ptr); - - std::size_t n_states = global_size; - - // initialization needs only on first step - auto deleter = [my_queue](auto* ptr) {sycl::free(ptr, my_queue);}; - auto rng_states_uptr = std::unique_ptr(sycl::malloc_device(n_states, my_queue), deleter); - auto* rng_states = rng_states_uptr.get(); - - my_queue.parallel_for>( - sycl::range<1>(n_states), - std::vector{rng_event_1, rng_event_2, rng_event_3}, - [=](sycl::item<1> idx) { - auto id = idx[0]; -#if USE_MRG - constexpr std::uint32_t seed = 12345u; - rng_states[id] = EngineTypeDevice({ seed, seed, seed, seed, seed, seed }, { 0, (4096 * id) }); -#else - rng_states[id] = EngineTypeDevice(rand_seed, id * ITEMS_PER_WORK_ITEM * VEC_SIZE * block_n); -#endif - }) - .wait_and_throw(); - - // main cycle - for (int i = 0; i < num_iterations; i++) - { - tt.start(); - - my_queue.parallel_for>( - sycl::nd_range<1>({global_size}, {local_size}), - [=](sycl::nd_item<1> item) - { - auto local_state = rng_states[item.get_global_id()]; - - for(std::size_t i = 0; i < ITEMS_PER_WORK_ITEM; ++i) - { - const std::size_t i_options = item.get_group_linear_id() * ITEMS_PER_WORK_ITEM + i; - DataType option_years = h_option_years_ptr[i_options]; - const DataType VBySqrtT = VLog2E * sycl::sqrt(option_years); - const DataType MuByT = MuLog2E * option_years; - const DataType Y = h_stock_price_ptr[i_options]; - const DataType Z = h_option_strike_ptr[i_options]; - DataType v0 = 0, v1 = 0; - - mkl_rng::device::gaussian distr(MuByT, VBySqrtT); - - for (int block = 0; block < block_n; ++block) - { - auto rng_val_vec = mkl_rng::device::generate(distr, local_state); - auto rng_val = Y * sycl::exp2(rng_val_vec) - Z; - for (int lane = 0; lane < VEC_SIZE; ++lane) - { - DataType rng_element = sycl::max(rng_val[lane], DataType{}); - - // reduce within the work-item - v0 += rng_element; - v1 += rng_element * rng_element; - } - } - - // reduce within the work-group - v0 = sycl::reduce_over_group(item.get_group(), v0, std::plus<>()); - v1 = sycl::reduce_over_group(item.get_group(), v1, std::plus<>()); - - const DataType exprt = sycl::exp2(RLog2E * option_years); - DataType call_result = exprt * v0 * (DataType(1) / fpath_lengthN); - - const DataType std_dev = sycl::sqrt((fpath_lengthN * v1 - v0 * v0) * stddev_denom); - DataType call_confidence = static_cast(exprt * std_dev * confidence_denom); - - if(item.get_local_id() == 0) - { - h_call_result_ptr[i_options] = call_result; - h_call_confidence_ptr[i_options] = call_confidence; - } - } - }).wait_and_throw(); - - tt.stop(); - if(i != 0) - total_time += tt.duration(); - } - std::cout << "Completed in " << total_time << " seconds. Options per second = " << static_cast(num_options * (num_iterations - 1)) / total_time << std::endl; - - // check results - check(h_call_result, h_call_confidence, h_stock_price, h_option_strike, h_option_years); - } - catch (sycl::exception e) { - std::cout << e.what(); - exit(1); - } -} - -int main(int argc, char** argv){ - bool is_fp64 = true; - { - sycl::queue test_queue; - is_fp64 = test_queue.get_device().has(sycl::aspect::fp64); - } - if (is_fp64) { - run(); - } else { - std::cout<<"Warning: could not find a device with double precision support. Single precision is used."<(); - } -} diff --git a/Libraries/oneMKL/monte_carlo_european_opt/src/timer.hpp b/Libraries/oneMKL/monte_carlo_european_opt/src/timer.hpp deleted file mode 100644 index 16dfbe2afb..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/src/timer.hpp +++ /dev/null @@ -1,20 +0,0 @@ -//============================================================== -// Copyright © 2022 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -#pragma once - -#include - -class timer -{ -public: - timer() { start(); } - void start() { t1_ = std::chrono::steady_clock::now(); } - void stop() { t2_ = std::chrono::steady_clock::now(); } - auto duration() { return std::chrono::duration(t2_ - t1_).count(); } -private: - std::chrono::steady_clock::time_point t1_, t2_; -}; diff --git a/Libraries/oneMKL/monte_carlo_european_opt/third-party-programs.txt b/Libraries/oneMKL/monte_carlo_european_opt/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/monte_carlo_european_opt/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/monte_carlo_pi/GNUmakefile b/Libraries/oneMKL/monte_carlo_pi/GNUmakefile deleted file mode 100644 index 6d0268d4a9..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/GNUmakefile +++ /dev/null @@ -1,28 +0,0 @@ -# Makefile for GNU Make - -default: run - -all: run - -run: mc_pi mc_pi_usm mc_pi_device_api - ./mc_pi - ./mc_pi_usm - ./mc_pi_device_api - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl=rng - -DPCPP_OPTS = $(MKL_COPTS) -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations $(MKL_LIBS) - -mc_pi: mc_pi.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -mc_pi_usm: mc_pi_usm.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -mc_pi_device_api: mc_pi_device_api.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -clean: - -rm -f mc_pi mc_pi_usm mc_pi_device_api - -.PHONY: clean run all diff --git a/Libraries/oneMKL/monte_carlo_pi/License.txt b/Libraries/oneMKL/monte_carlo_pi/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/monte_carlo_pi/README.md b/Libraries/oneMKL/monte_carlo_pi/README.md deleted file mode 100644 index b829c11b64..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# `Monte Carlo Pi Estimation` Sample - -Monte Carlo Pi Estimation shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) random number generation (RNG) functionality to estimate the value of π. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use the oneMKL random number generation functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose -Monte Carlo Pi Estimation uses a randomized method to estimate the value of π. The basic idea is to generate random points within a square, and to check what fraction of these random points lie in a quarter-circle inscribed in that square. The expected value is the ratio of the areas of the quarter-circle and the square, namely π/4, so we can take the observed fraction of points in the quarter-circle as an estimate of π/4. - -This sample uses the oneMKL random number generation functionality to produce the random points. oneMKL RNG has APIs that can be called from the host, and APIs that can be called from within a kernel; both kinds of APIs are illustrated. - -This sample performs its computations on the default SYCL* device. You can set the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - - -## Key Implementation Details - -This sample illustrates how to create an RNG engine object (the source of pseudo-randomness), a distribution object (specifying the desired probability distribution), and finally generate the random numbers themselves. Random number generation can be done from the host, storing the results in a SYCL*-compliant buffer or USM pointer, or directly in a kernel. - -In this sample, a Philox 4x32x10 generator is used, and a uniform distribution is the basis for the Monte Carlo simulation. oneMKL provides many other generators and distributions to suit a range of applications. - -## Using Visual Studio Code* (Optional) -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the [Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Monte Carlo Pi Estimation Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build and run the sample. Three programs are generated, which illustrate different APIs for random number generation. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -> **Warning**: On Windows, static linking with oneMKL currently takes a very long time, due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Monte Carlo Pi Estimation Sample -### Example of Output -If everything is working correctly, after building you will see step-by-step output from each of the three example programs, providing the generated estimate of π. -``` -./mc_pi - -Monte Carlo pi Calculation Simulation -Buffer API -------------------------------------- -Number of points = 120000000 -Estimated value of Pi = 3.14106 -Exact value of Pi = 3.14159 -Absolute error = 0.000530387 - -TEST PASSED - -./mc_pi_usm - -Monte Carlo pi Calculation Simulation -Unified Shared Memory API -------------------------------------- -Number of points = 120000000 -Estimated value of Pi = 3.14106 -Exact value of Pi = 3.14159 -Absolute error = 0.000530387 - -TEST PASSED - -./mc_pi_device_api - -Monte Carlo pi Calculation Simulation -Device API -------------------------------------- -Number of points = 120000000 -Estimated value of Pi = 3.14159 -Exact value of Pi = 3.14159 -Absolute error = 5.95359e-06 - -TEST PASSED -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/monte_carlo_pi/makefile b/Libraries/oneMKL/monte_carlo_pi/makefile deleted file mode 100644 index 30b8ffe59e..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/makefile +++ /dev/null @@ -1,26 +0,0 @@ -# Makefile for NMAKE - -default: run - -all: run - -run: mc_pi.exe mc_pi_usm.exe mc_pi_device_api.exe - .\mc_pi.exe - .\mc_pi_usm.exe - .\mc_pi_device_api.exe - -DPCPP_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl=rng /DMKL_ILP64 /EHsc -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations OpenCL.lib - -mc_pi.exe: mc_pi.cpp - icx-cl -fsycl mc_pi.cpp /Femc_pi.exe $(DPCPP_OPTS) - -mc_pi_usm.exe: mc_pi_usm.cpp - icx-cl -fsycl mc_pi_usm.cpp /Femc_pi_usm.exe $(DPCPP_OPTS) - -mc_pi_device_api.exe: mc_pi_device_api.cpp - icx-cl -fsycl mc_pi_device_api.cpp /Femc_pi_device_api.exe $(DPCPP_OPTS) - -clean: - del /q mc_pi.exe mc_pi_usm.exe mc_pi_device_api.exe - -pseudo: clean run all diff --git a/Libraries/oneMKL/monte_carlo_pi/mc_pi.cpp b/Libraries/oneMKL/monte_carlo_pi/mc_pi.cpp deleted file mode 100644 index f94945f4d6..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/mc_pi.cpp +++ /dev/null @@ -1,135 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This file contains Monte Carlo Pi number evaluation benchmark for DPC++ -* interface of random number generators. -* -*******************************************************************************/ - -#include -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -// Value of Pi with many exact digits to compare with estimated value of Pi -static const auto pi = 3.1415926535897932384626433832795; - -// Initialization value for random number generator -static const auto seed = 7777; - -// Default Number of 2D points -static const auto n_samples = 120'000'000; - -double estimate_pi(sycl::queue& q, size_t n_points) { - double estimated_pi; // Estimated value of Pi - size_t n_under_curve = 0; // Number of points fallen under the curve - - // Step 1. Generate n_points * 2 random numbers - // 1.1. Generator initialization - // Create an object of basic random number generator (engine) - mkl::rng::philox4x32x10 engine(q, seed); - // Create an object of distribution (by default float, a = 0.0f, b = 1.0f) - mkl::rng::uniform distr; - - sycl::buffer rng_buf(n_points * 2); - - // 1.2. Random number generation - mkl::rng::generate(distr, engine, n_points * 2, rng_buf); - - // Step 2. Count points under curve (x ^ 2 + y ^ 2 < 1.0f) - constexpr size_t count_per_thread = 32; - - { - sycl::buffer count_buf{ &n_under_curve, 1 }; - - q.submit([&] (sycl::handler& h) { - auto rng_acc = rng_buf.template get_access(h); - auto reductor = sycl::reduction(count_buf, h, size_t(0), std::plus()); - - h.parallel_for(sycl::range<1>(n_points / count_per_thread), reductor, - [=](sycl::item<1> item, auto& sum) { - sycl::vec r; - size_t count = 0; - for(int i = 0; i < count_per_thread; i++) { - r.load(i + item.get_id(0) * count_per_thread, rng_acc.template get_multi_ptr()); - if(sycl::length(r) <= 1.0f) { - count++; - } - } - sum += count; - }); - }); - } - - // Step 3. Calculate approximated value of Pi - estimated_pi = n_under_curve / ((double)n_points) * 4.0; - return estimated_pi; - -} - -int main(int argc, char ** argv) { - - std::cout << std::endl; - std::cout << "Monte Carlo pi Calculation Simulation" << std::endl; - std::cout << "Buffer Api" << std::endl; - std::cout << "-------------------------------------" << std::endl; - - double estimated_pi; - size_t n_points = n_samples; - if(argc >= 2) { - n_points = atol(argv[1]); - if(n_points == 0) { - n_points = n_samples; - } - } - std::cout << "Number of points = " << n_points << std::endl; - - // This exception handler with catch async exceptions - auto exception_handler = [&](sycl::exception_list exceptions) { - for(std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception:\n" << e.what() << std::endl; - std::terminate(); - } - } - }; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Launch Pi number calculation - estimated_pi = estimate_pi(q, n_points); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Printing results - double abs_error = std::fabs(pi - estimated_pi); - std::cout << "Estimated value of Pi = " << estimated_pi << std::endl; - std::cout << "Exact value of Pi = " << pi << std::endl; - std::cout << "Absolute error = " << abs_error << std::endl; - std::cout << std::endl; - - if(abs_error > 1.0e-4) { - std::cout << "TEST FAILED" << std::endl; - return 1; - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/monte_carlo_pi/mc_pi_device_api.cpp b/Libraries/oneMKL/monte_carlo_pi/mc_pi_device_api.cpp deleted file mode 100644 index a67710c69c..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/mc_pi_device_api.cpp +++ /dev/null @@ -1,132 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This file contains Monte Carlo Pi number evaluation benchmark for DPC++ -* device interface of random number generators. -* -*******************************************************************************/ - -#include -#include -#include - -#include -#include "oneapi/mkl/rng/device.hpp" - -using namespace oneapi; - -// Value of Pi with many exact digits to compare with estimated value of Pi -static const auto pi = 3.1415926535897932384626433832795; - -// Initialization value for random number generator -static const auto seed = 7777; - -// Default Number of 2D points -static const auto n_samples = 120'000'000; - -double estimate_pi(sycl::queue& q, size_t n_points) { - double estimated_pi; // Estimated value of Pi - size_t n_under_curve = 0; // Number of points fallen under the curve - - constexpr size_t count_per_thread = 32; - - constexpr size_t vec_size = 2; - - { - sycl::buffer count_buf(&n_under_curve, 1); - - q.submit([&] (sycl::handler& h) { - auto count_acc = count_buf.template get_access(h); - h.parallel_for(sycl::range<1>(n_points / (count_per_thread * vec_size / 2)), - [=](sycl::item<1> item) { - size_t id_global = item.get_id(0); - sycl::vec r; - sycl::atomic_ref atomic_counter { count_acc[0] }; - size_t count = 0; - - // Create an object of basic random number generator (engine) - mkl::rng::device::philox4x32x10 engine(seed, id_global * count_per_thread * vec_size); - // Create an object of distribution (by default float, a = 0.0f, b = 1.0f) - mkl::rng::device::uniform distr; - - for(int i = 0; i < count_per_thread; i++) { - // Step 1. Generate 2D point - r = mkl::rng::device::generate(distr, engine); - // Step 2. Increment counter if point is under curve (x ^ 2 + y ^ 2 < 1.0f) - if(sycl::length(r) <= 1.0f) { - count++; - } - } - atomic_counter.fetch_add(count); - }); - }); - } - - estimated_pi = n_under_curve / ((double)n_points) * 4.0; - return estimated_pi; - -} - -int main(int argc, char ** argv) { - - std::cout << std::endl; - std::cout << "Monte Carlo pi Calculation Simulation" << std::endl; - std::cout << "Device Api" << std::endl; - std::cout << "-------------------------------------" << std::endl; - - double estimated_pi; - size_t n_points = n_samples; - if(argc >= 2) { - n_points = atol(argv[1]); - if(n_points == 0) { - n_points = n_samples; - } - } - std::cout << "Number of points = " << n_points << std::endl; - - // This exception handler with catch async exceptions - auto exception_handler = [&](sycl::exception_list exceptions) { - for(std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception:\n" << e.what() << std::endl; - std::terminate(); - } - } - }; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Launch Pi number calculation - estimated_pi = estimate_pi(q, n_points); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Printing results - double abs_error = std::fabs(pi - estimated_pi); - std::cout << "Estimated value of Pi = " << estimated_pi << std::endl; - std::cout << "Exact value of Pi = " << pi << std::endl; - std::cout << "Absolute error = " << abs_error << std::endl; - std::cout << std::endl; - - if(abs_error > 1.0e-4) { - std::cout << "TEST FAILED" << std::endl; - return 1; - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/monte_carlo_pi/mc_pi_usm.cpp b/Libraries/oneMKL/monte_carlo_pi/mc_pi_usm.cpp deleted file mode 100644 index 9be488eda7..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/mc_pi_usm.cpp +++ /dev/null @@ -1,132 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This file contains Monte Carlo Pi number evaluation benchmark for DPC++ -* USM-based interface of random number generators. -* -*******************************************************************************/ - -#include -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -// Value of Pi with many exact digits to compare with estimated value of Pi -static const auto pi = 3.1415926535897932384626433832795; - -// Initialization value for random number generator -static const auto seed = 7777; - -// Default Number of 2D points -static const auto n_samples = 120'000'000; - -double estimate_pi(sycl::queue& q, size_t n_points) { - double estimated_pi; // Estimated value of Pi - - // Step 1. Generate n_points * 2 random numbers - // 1.1. Generator initialization - // Create an object of basic random number generator (engine) - mkl::rng::philox4x32x10 engine(q, seed); - // Create an object of distribution (by default float, a = 0.0f, b = 1.0f) - mkl::rng::uniform distr; - - float* rng_ptr = sycl::malloc_shared(n_points * 2, q); - - // 1.2. Random number generation - auto event = mkl::rng::generate(distr, engine, n_points * 2, rng_ptr); - - // Step 2. Count points under curve (x ^ 2 + y ^ 2 < 1.0f) - constexpr size_t count_per_thread = 32; - size_t *n_under_curve = sycl::malloc_host(1, q); // Number of points fallen under the curve - *n_under_curve = 0; - auto reductor = sycl::reduction(n_under_curve, size_t(0), std::plus{}); - - q.parallel_for(sycl::range<1>(n_points / count_per_thread), event, reductor, - [=](sycl::item<1> item, auto& sum) { - sycl::vec r; - size_t count = 0; - for(int i = 0; i < count_per_thread; i++) { - r.load(i + item.get_id(0) * count_per_thread, sycl::global_ptr(rng_ptr)); - if(sycl::length(r) <= 1.0f) { - count++; - } - } - sum += count; - }).wait_and_throw(); - - // Step 3. Calculate approximated value of Pi - estimated_pi = *n_under_curve / ((double)n_points) * 4.0; - - sycl::free(rng_ptr, q); - sycl::free(n_under_curve, q); - - return estimated_pi; - -} - -int main(int argc, char ** argv) { - - std::cout << std::endl; - std::cout << "Monte Carlo pi Calculation Simulation" << std::endl; - std::cout << "Unified Shared Memory Api" << std::endl; - std::cout << "-------------------------------------" << std::endl; - - double estimated_pi; - size_t n_points = n_samples; - if(argc >= 2) { - n_points = atol(argv[1]); - if(n_points == 0) { - n_points = n_samples; - } - } - std::cout << "Number of points = " << n_points << std::endl; - - // This exception handler with catch async exceptions - auto exception_handler = [&](sycl::exception_list exceptions) { - for(std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception:\n" << e.what() << std::endl; - std::terminate(); - } - } - }; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Launch Pi number calculation - estimated_pi = estimate_pi(q, n_points); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Printing results - double abs_error = std::fabs(pi - estimated_pi); - std::cout << "Estimated value of Pi = " << estimated_pi << std::endl; - std::cout << "Exact value of Pi = " << pi << std::endl; - std::cout << "Absolute error = " << abs_error << std::endl; - std::cout << std::endl; - - if(abs_error > 1.0e-4) { - std::cout << "TEST FAILED" << std::endl; - return 1; - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/monte_carlo_pi/sample.json b/Libraries/oneMKL/monte_carlo_pi/sample.json deleted file mode 100644 index 5004bc3ccc..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "7F805BC5-F9A9-43B3-BBCB-580063CD59F8", - "name": "Monte Carlo Pi", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Estimating Pi with Intel® oneMKL random number generators", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "monte_carlo_pi", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "monte_carlo_pi", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/monte_carlo_pi/third-party-programs.txt b/Libraries/oneMKL/monte_carlo_pi/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/monte_carlo_pi/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/random_sampling_without_replacement/GNUmakefile b/Libraries/oneMKL/random_sampling_without_replacement/GNUmakefile deleted file mode 100644 index be516f5204..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/GNUmakefile +++ /dev/null @@ -1,28 +0,0 @@ -# Makefile for GNU Make - -default: run - -all: run - -run: lottery lottery_usm lottery_device_api - ./lottery - ./lottery_usm - ./lottery_device_api - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl=rng - -DPCPP_OPTS = $(MKL_COPTS) -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations - -lottery: lottery.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -lottery_usm: lottery_usm.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -lottery_device_api: lottery_device_api.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -clean: - -rm -f lottery lottery_usm lottery_device_api - -.PHONY: clean run all diff --git a/Libraries/oneMKL/random_sampling_without_replacement/License.txt b/Libraries/oneMKL/random_sampling_without_replacement/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/random_sampling_without_replacement/README.md b/Libraries/oneMKL/random_sampling_without_replacement/README.md deleted file mode 100644 index 1e24a44031..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# `Multiple Simple Random Sampling without replacement` Sample - -Multiple Simple Random Sampling without replacement shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) random number generation (RNG) functionality to generate K>>1 simple random length-M samples without replacement from a population of size N (1 ≤ M ≤ N). - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use the oneMKL random number generation functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -The sample demonstrates the Partial Fisher-Yates Shuffle algorithm conducts 11 969 664 experiments. Each experiment, which generates a sequence of M unique random natural numbers from 1 to N, is a partial length-M random shuffle of N elements' whole population. Because the algorithm's main loop works as a real lottery, each experiment is called "lottery M of N" in the program. -The program uses M=6 and N=49 and stores result samples (sequences of length M) in a single array. - -This sample uses the oneMKL random number generation functionality to produce random numbers. oneMKL RNG has APIs that can be called from the host, and APIs can be reached from within a kernel; both kinds of APIs are illustrated. - -This sample performs its computations on the default SYCL* device. You can set the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - - -## Key Implementation Details - -This sample illustrates how to create an RNG engine object (the source of pseudo-randomness), a distribution object (specifying the desired probability distribution), and finally generate the random numbers themselves. Random number generation can be done from the host, storing the results in a SYCL-compliant buffer or USM pointer or directly in a kernel. - -In this sample, a Philox 4x32x10 generator is used, and a uniform distribution is a basis for the algorithm. oneMKL provides many other generators and distributions to suit a range of applications. - -## Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Multiple Simple Random Sampling without replacement Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build and run the sample. Three programs are generated, which illustrate different APIs for random number generation. - -You can remove all generated files with `make clean.` - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -*Warning*: On Windows, static linking with oneMKL currently takes a very long time due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Multiple Simple Random Sampling without replacement Sample - -### Example of Output -After building, if everything is working correctly, you will see the step-by-step output from each of the three example programs, providing the lottery results. -``` -./lottery - -Multiple Simple Random Sampling without replacement -Buffer Api ---------------------------------------------------- -M = 6, N = 49, Number of experiments = 11969664 -Sample 11969661 of lottery of 11969664: 19, 5, 17, 27, 44, 34, -Sample 11969662 of lottery of 11969664: 31, 39, 6, 19, 48, 15, -Sample 11969663 of lottery of 11969664: 24, 11, 29, 44, 2, 20, - -TEST PASSED - -./lottery_usm - -Multiple Simple Random Sampling without replacement -Unified Shared Memory API ---------------------------------------------------- -M = 6, N = 49, Number of experiments = 11969664 -Results with Host API: -Sample 11969661 of lottery of 11969664: 19, 5, 17, 27, 44, 34, -Sample 11969662 of lottery of 11969664: 31, 39, 6, 19, 48, 15, -Sample 11969663 of lottery of 11969664: 24, 11, 29, 44, 2, 20, - -TEST PASSED - -./lottery_device_api - -Multiple Simple Random Sampling without replacement -Device API ---------------------------------------------------- -M = 6, N = 49, Number of experiments = 11969664 -Sample 11969661 of lottery of 11969664: 19, 5, 17, 27, 44, 34, -Sample 11969662 of lottery of 11969664: 31, 39, 6, 19, 48, 15, -Sample 11969663 of lottery of 11969664: 24, 11, 29, 44, 2, 20, - -TEST PASSED -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/random_sampling_without_replacement/lottery.cpp b/Libraries/oneMKL/random_sampling_without_replacement/lottery.cpp deleted file mode 100644 index 3f4fedb4fc..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/lottery.cpp +++ /dev/null @@ -1,156 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This file contains Multiple Simple Random Sampling without replacement -* for DPC++ USM-based interface of random number generators -* -*******************************************************************************/ - -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -// Initialization value for random number generator -static const auto seed = 777; - -// Lottery default parameters -static const auto m_def = 6; // lottery first parameter -static const auto n_def = 49; // lottery second parameter -static const auto num_exp_def = 11969664; // number of lottery experiments - -void lottery(sycl::queue& q, size_t m, size_t n, size_t num_exp, size_t* result_ptr) { - - // Generate (m * num_exp) random numbers - // Generator initialization - // Create an object of basic random number generator (engine) - oneapi::mkl::rng::philox4x32x10 engine(q, seed); - // Create an object of distribution (by default float, a = 0.0f, b = 1.0f) - oneapi::mkl::rng::uniform distr; - - float* rng_buf = sycl::malloc_device(m * num_exp, q); - - // Random number generation - auto event = oneapi::mkl::rng::generate(distr, engine, m * num_exp, rng_buf); - // Make sure, that generation is finished - event.wait_and_throw(); - - { - - event = q.submit([&] (sycl::handler& h) { - sycl::local_accessor local_buf(sycl::range<1>{n}, h); - h.parallel_for(sycl::nd_range<1>(num_exp, 1), - [=](sycl::nd_item<1> item) { - size_t id = item.get_group(0); - // Let buf contain natural numbers 1, 2, ..., N - for (size_t i = 0; i < n; ++i) { - local_buf[i] = i + 1; - } - // Shuffle copied buffer - for (size_t i = 0; i < m; ++i) { - // Generate random natural number j from {i,...,N-1} - auto j = i + (size_t)(rng_buf[id * m + i] * (float)(n - i)); - // Swap local_buf[i] and local_buf[j] - std::swap(local_buf[i], local_buf[j]); - } - for (size_t i = 0; i < m; ++i) { - // Copy shuffled buffer - result_ptr[id * m + i] = local_buf[i]; - } - }); - }); - } - - event.wait_and_throw(); -} - -// Prints last 3 lottery samples -void print_results(size_t* result_ptr, size_t m, size_t num_exp) { - for (size_t i = num_exp - 3; i < num_exp; ++i) { - std::cout << "Sample " << i << " of lottery of " << num_exp << ": "; - for (size_t j = 0; j < m; ++j) { - std::cout << result_ptr[i * m + j] << ", "; - } - std::cout << std::endl; - } - std::cout << std::endl; -} - -int main(int argc, char ** argv) { - - std::cout << std::endl; - std::cout << "Multiple Simple Random Sampling without replacement" << std::endl; - std::cout << "Buffer Api" << std::endl; - std::cout << "---------------------------------------------------" << std::endl; - - size_t m = m_def; - size_t n = n_def; - size_t num_exp = num_exp_def; - if(argc >= 4) { - m = atol(argv[1]); - n = atol(argv[2]); - num_exp = atol(argv[3]); - if(m == 0 || n == 0 || num_exp == 0 || m > n) { - m = m_def; - n = n_def; - num_exp = num_exp_def; - } - } - std::cout << "M = " << m << ", N = " << n << ", Number of experiments = " << num_exp << std::endl; - // This exception handler will catch async exceptions - auto exception_handler = [&](sycl::exception_list exceptions) { - for(std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception:\n" << e.what() << std::endl; - std::terminate(); - } - } - }; - - // Pointer to result storage - size_t* result_ptr; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Allocate memory - result_ptr = sycl::malloc_shared(m * num_exp, q); - // Launch lottery for Host USM API - lottery(q, m, n, num_exp, result_ptr); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Print output - print_results(result_ptr, m, num_exp); - - // Check correctness whether experiment contains unique numbers or not - for(size_t i = 0; i < num_exp; ++i){ - auto first_iter = result_ptr + m * i; - std::sort(first_iter, first_iter + m); - if(std::adjacent_find(first_iter, first_iter + m) != first_iter + m && - // if all elements are in the [0, n] range - std::count_if(first_iter, first_iter + m, [n](auto val){return val > n && val >= 0;}) == 0) - { - std::cout << "TEST FAILED" << std::endl; - std::cout << "Error: the experiment "<< i <<" contains duplicates" << std::endl; - return 1; - } - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/random_sampling_without_replacement/lottery_device_api.cpp b/Libraries/oneMKL/random_sampling_without_replacement/lottery_device_api.cpp deleted file mode 100644 index b2567cce48..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/lottery_device_api.cpp +++ /dev/null @@ -1,145 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This file contains Multiple Simple Random Sampling without replacement -* for DPC++ device interface of random number generators -* -*******************************************************************************/ - -#include -#include - -#include -#include "oneapi/mkl/rng/device.hpp" - -using namespace oneapi; - -// Initialization value for random number generator -static const auto seed = 777; - -// Lottery default parameters -static const auto m_def = 6; // lottery first parameter -static const auto n_def = 49; // lottery second parameter -static const auto num_exp_def = 11969664; // number of lottery experiments - -void lottery_device_api(sycl::queue& q, size_t m, size_t n, size_t num_exp, std::vector& result_vec) { - - { - sycl::buffer result_buf(result_vec.data(), result_vec.size()); - - q.submit([&](sycl::handler& h) { - auto res_acc = result_buf.template get_access(h); - sycl::local_accessor local_buf(sycl::range<1>{n}, h); - h.parallel_for(sycl::nd_range<1>(num_exp, 1), - [=](sycl::nd_item<1> item) { - size_t id = item.get_group(0); - // Let buf contain natural numbers 1, 2, ..., N - for (size_t i = 0; i < n; ++i) { - local_buf[i] = i + 1; - } - // Create an object of basic random number generator (engine) - oneapi::mkl::rng::device::philox4x32x10 engine(seed, id * m); - // Create an object of distribution (by default float, a = 0.0f, b = 1.0f) - oneapi::mkl::rng::device::uniform distr; - - for (size_t i = 0; i < m; ++i) { - auto res = oneapi::mkl::rng::device::generate(distr, engine); - // Generate random natural number j from {i,...,N-1} - auto j = i + (size_t)(res * (float)(n - i)); - // Swap local_buf[i] and local_buf[j] - std::swap(local_buf[i], local_buf[j]); - } - for (size_t i = 0; i < m; ++i) { - // Copy shuffled buffer - res_acc[id * m + i] = local_buf[i]; - } - }); - }); - } -} - -// Prints last 3 lottery samples -void print_results(std::vector& res, size_t m) { - for (size_t i = res.size() / m - 3; i < res.size() / m; ++i) { - std::cout << "Sample " << i << " of lottery of " << res.size() / m << ": "; - for (size_t j = 0; j < m; ++j) { - std::cout << res[i * m + j] << ", "; - } - std::cout << std::endl; - } - std::cout << std::endl; -} - -int main(int argc, char ** argv) { - - std::cout << std::endl; - std::cout << "Multiple Simple Random Sampling without replacement" << std::endl; - std::cout << "Device Api" << std::endl; - std::cout << "---------------------------------------------------" << std::endl; - - size_t m = m_def; - size_t n = n_def; - size_t num_exp = num_exp_def; - if(argc >= 4) { - m = atol(argv[1]); - n = atol(argv[2]); - num_exp = atol(argv[3]); - if(m == 0 || n == 0 || num_exp == 0 || m > n) { - m = m_def; - n = n_def; - num_exp = num_exp_def; - } - } - std::cout << "M = " << m << ", N = " << n << ", Number of experiments = " << num_exp << std::endl; - // This exception handler will catch async exceptions - auto exception_handler = [&](sycl::exception_list exceptions) { - for(std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception:\n" << e.what() << std::endl; - std::terminate(); - } - } - }; - - // Result storage - std::vector result_vec(m * num_exp); - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Launch lottery for device API - lottery_device_api(q, m, n, num_exp, result_vec); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Print output - print_results(result_vec, m); - - // Check correctness whether experiment contains unique numbers or not - for(size_t i = 0; i < num_exp; ++i){ - auto first_iter = result_vec.begin() + m * i; - std::sort(first_iter, first_iter + m); - if(std::adjacent_find(first_iter, first_iter + m) != first_iter + m && - // if all elements are in the [0, n] range - std::count_if(first_iter, first_iter + m, [n](auto val){return val > n && val >= 0;}) == 0) - { - std::cout << "TEST FAILED" << std::endl; - std::cout << "Error: the experiment "<< i <<" contains duplicates" << std::endl; - return 1; - } - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/random_sampling_without_replacement/lottery_usm.cpp b/Libraries/oneMKL/random_sampling_without_replacement/lottery_usm.cpp deleted file mode 100644 index 4d8b0b399d..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/lottery_usm.cpp +++ /dev/null @@ -1,157 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This file contains Multiple Simple Random Sampling without replacement -* for DPC++ USM-based interface of random number generators -* -*******************************************************************************/ - -#include -#include - -#include -#include "oneapi/mkl.hpp" - -using namespace oneapi; - -// Initialization value for random number generator -static const auto seed = 777; - -// Lottery default parameters -static const auto m_def = 6; // lottery first parameter -static const auto n_def = 49; // lottery second parameter -static const auto num_exp_def = 11969664; // number of lottery experiments - -void lottery(sycl::queue& q, size_t m, size_t n, size_t num_exp, size_t* result_ptr) { - - // Generate (m * num_exp) random numbers - // Generator initialization - // Create an object of basic random number generator (engine) - oneapi::mkl::rng::philox4x32x10 engine(q, seed); - // Create an object of distribution (by default float, a = 0.0f, b = 1.0f) - oneapi::mkl::rng::uniform distr; - - float* rng_buf = sycl::malloc_device(m * num_exp, q); - - // Random number generation - auto event = oneapi::mkl::rng::generate(distr, engine, m * num_exp, rng_buf); - // Make sure, that generation is finished - event.wait_and_throw(); - - { - - event = q.submit([&] (sycl::handler& h) { - sycl::local_accessor local_buf(sycl::range<1>{n}, h); - h.parallel_for(sycl::nd_range<1>(num_exp, 1), - [=](sycl::nd_item<1> item) { - size_t id = item.get_group(0); - // Let buf contain natural numbers 1, 2, ..., N - for (size_t i = 0; i < n; ++i) { - local_buf[i] = i + 1; - } - // Shuffle copied buffer - for (size_t i = 0; i < m; ++i) { - // Generate random natural number j from {i,...,N-1} - auto j = i + (size_t)(rng_buf[id * m + i] * (float)(n - i)); - // Swap local_buf[i] and local_buf[j] - std::swap(local_buf[i], local_buf[j]); - } - for (size_t i = 0; i < m; ++i) { - // Copy shuffled buffer - result_ptr[id * m + i] = local_buf[i]; - } - }); - }); - } - - event.wait_and_throw(); -} - -// Prints last 3 lottery samples -void print_results(size_t* result_ptr, size_t m, size_t num_exp) { - for (size_t i = num_exp - 3; i < num_exp; ++i) { - std::cout << "Sample " << i << " of lottery of " << num_exp << ": "; - for (size_t j = 0; j < m; ++j) { - std::cout << result_ptr[i * m + j] << ", "; - } - std::cout << std::endl; - } - std::cout << std::endl; -} - -int main(int argc, char ** argv) { - - std::cout << std::endl; - std::cout << "Multiple Simple Random Sampling without replacement" << std::endl; - std::cout << "Unified Shared Memory Api" << std::endl; - std::cout << "---------------------------------------------------" << std::endl; - - size_t m = m_def; - size_t n = n_def; - size_t num_exp = num_exp_def; - if(argc >= 4) { - m = atol(argv[1]); - n = atol(argv[2]); - num_exp = atol(argv[3]); - if(m == 0 || n == 0 || num_exp == 0 || m > n) { - m = m_def; - n = n_def; - num_exp = num_exp_def; - } - } - std::cout << "M = " << m << ", N = " << n << ", Number of experiments = " << num_exp << std::endl; - // This exception handler will catch async exceptions - auto exception_handler = [&](sycl::exception_list exceptions) { - for(std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception:\n" << e.what() << std::endl; - std::terminate(); - } - } - }; - - // Pointer to result storage - size_t* result_ptr; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Allocate memory - result_ptr = sycl::malloc_shared(m * num_exp, q); - // Launch lottery for Host USM API - lottery(q, m, n, num_exp, result_ptr); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Print output - std::cout << "Results with Host API:" << std::endl; - print_results(result_ptr, m, num_exp); - - // Check correctness whether experiment contains unique numbers or not - for(size_t i = 0; i < num_exp; ++i){ - auto first_iter = result_ptr + m * i; - std::sort(first_iter, first_iter + m); - if(std::adjacent_find(first_iter, first_iter + m) != first_iter + m && - // if all elements are in the [0, n] range - std::count_if(first_iter, first_iter + m, [n](auto val){return val > n && val >= 0;}) == 0) - { - std::cout << "TEST FAILED" << std::endl; - std::cout << "Error: the experiment "<< i <<" contains duplicates" << std::endl; - return 1; - } - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/random_sampling_without_replacement/makefile b/Libraries/oneMKL/random_sampling_without_replacement/makefile deleted file mode 100644 index 8ac1783d77..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/makefile +++ /dev/null @@ -1,37 +0,0 @@ -# Makefile for NMAKE - -default: run - -all: run - -run: lottery.exe lottery_usm.exe lottery_device_api.exe - .\lottery.exe - .\lottery_usm.exe - .\lottery_device_api.exe - -DPCPP_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl=rng /DMKL_ILP64 /EHsc -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations OpenCL.lib - -lottery.exe: lottery.cpp - icx-cl -fsycl lottery.cpp /Felottery.exe $(DPCPP_OPTS) - -lottery_usm.exe: lottery_usm.cpp - icx-cl -fsycl lottery_usm.cpp /Felottery_usm.exe $(DPCPP_OPTS) - -lottery_device_api.exe: lottery_device_api.cpp - icx-cl -fsycl lottery_device_api.cpp /Felottery_device_api.exe $(DPCPP_OPTS) - -clean: - del /q lottery.exe lottery_usm.exe lottery_device_api.exe - -pseudo: clean run all - -# DPCPP_OPTS = $(MKL_COPTS) -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations $(MKL_LIBS) - -# lottery: lottery.cpp -# icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -# lottery_usm: lottery_usm.cpp -# icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -# lottery_device_api: lottery_device_api.cpp -# icpx $< -fsycl -o $@ $(DPCPP_OPTS) diff --git a/Libraries/oneMKL/random_sampling_without_replacement/sample.json b/Libraries/oneMKL/random_sampling_without_replacement/sample.json deleted file mode 100644 index 7eea76ce78..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "7AC408C8-DF59-46AE-B970-178CF257F364", - "name": "Random Sampling Without Replacement", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Multiple simple random sampling without replacement with Intel® oneMKL random number generators", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "random_sampling_without_replacement", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "random_sampling_without_replacement", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" - } diff --git a/Libraries/oneMKL/random_sampling_without_replacement/third-party-programs.txt b/Libraries/oneMKL/random_sampling_without_replacement/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/random_sampling_without_replacement/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/GNUmakefile b/Libraries/oneMKL/sparse_conjugate_gradient/GNUmakefile deleted file mode 100644 index 11ff841273..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/GNUmakefile +++ /dev/null @@ -1,24 +0,0 @@ -# Makefile for GNU Make - -default: run - -all: run - -run: sparse_cg sparse_cg2 - ./sparse_cg - ./sparse_cg2 - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl="blas,sparse" - -DPCPP_OPTS = $(MKL_COPTS) -fsycl-device-code-split=per_kernel - -sparse_cg: sparse_cg.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -sparse_cg2: sparse_cg2.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -clean: - -rm -f sparse_cg sparse_cg2 genxir - -.PHONY: clean run all diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/License.txt b/Libraries/oneMKL/sparse_conjugate_gradient/License.txt deleted file mode 100644 index e63c6e13dc..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/README.md b/Libraries/oneMKL/sparse_conjugate_gradient/README.md deleted file mode 100644 index dda7c6c0f4..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# `Sparse Conjugate Gradient` Sample -Sparse Conjugate Gradient shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) sparse linear algebra functionality to solve a sparse, symmetric linear system using the (preconditioned) conjugate gradient method. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use oneMKL sparse linear algebra functionality -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose -Sparse Conjugate Gradient uses oneMKL sparse linear algebra routines to solve a system of linear equations Ax = b, where the A matrix is symmetric and sparse. The symmetric Gauss-Seidel preconditioner is used to accelerate convergence. - -This sample performs its computations on the default SYCL* device. You can set the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - -## Key Implementation Details -oneMKL sparse routines use a two-stage method where the sparse matrix is analyzed to prepare subsequent calculations (the _optimize_ step). Sparse matrix-vector multiplication and triangular solves (`gemv` and `trsv`) are used to implement the main loop, along with vector routines from BLAS. Two implementations are provided: The first implementation, in `sparse_cg.cpp`, has several places where a device to host copy and wait are initiated to allow the alpha and beta coefficients to be initiated in the BLAS vector routines as host scalars. The second implementation, in `sparse_cg2.cpp`, keeps the coefficients for alpha and beta on the device, which require that custom axpby2 and axpy3 functions are written to handle the construction of alpha and beta coefficients on-the-fly from the device. This removes some of the synchronization points that are seen in the first implementation. - -## Using Visual Studio Code* (Optional) -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - -## Building the Sparse Conjugate Gradient Sample -> **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script located in -> the root of your oneAPI installation. -> -> Linux*: -> - For system wide installations: `. /opt/intel/oneapi/setvars.sh` -> - For private installations: `. ~/intel/oneapi/setvars.sh` -> - For non-POSIX shells, like csh, use the following command: `$ bash -c 'source /setvars.sh ; exec csh'` -> -> Windows*: -> - `C:\"Program Files (x86)"\Intel\oneAPI\setvars.bat` -> - For Windows PowerShell*, use the following command: `cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'` -> -> For more information on configuring environment variables, see [Use the setvars Script with Linux* or MacOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html) or [Use the setvars Script with Windows*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-windows.html). - -### On a Linux* System -Run `make` to build and run the sample. - -You can remove all generated files with `make clean.` - -### On a Windows* System -Run `nmake` to build and run the sample. `nmake clean` removes temporary files. - -> **Warning**: On Windows, static linking with oneMKL currently takes a very long time due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Sparse Conjugate Gradient Sample - -### Example of Output -If everything is working correctly, the example programs will rapidly converge to a solution. Each test will run in both single and double precision (if available on the selected device). - -The first PCG implementation with host side coefficients: -``` -./sparse_cg -######################################################################## -# Sparse Preconditioned Conjugate Gradient Solver with USM -# -# Uses the preconditioned conjugate gradient algorithm to -# iteratively solve the symmetric linear system -# -# A * x = b -# -# where A is a symmetric sparse matrix in CSR format, and -# x and b are dense vectors. -# -# Uses the symmetric Gauss-Seidel preconditioner. -# -# alpha and beta constants in PCG algorithm are host side. -# -######################################################################## - -Running tests on Intel(R) Data Center GPU Max 1550. - Running with single precision real data type: - - sparse PCG parameters: - A size: (4096, 4096) - Preconditioner = Symmetric Gauss-Seidel - max iterations = 500 - relative tolerance limit = 1e-05 - absolute tolerance limit = 0.0005 - relative norm of residual on 1 iteration: 0.178532 - relative norm of residual on 2 iteration: 0.0280123 - relative norm of residual on 3 iteration: 0.0048948 - relative norm of residual on 4 iteration: 0.000796108 - relative norm of residual on 5 iteration: 0.000119025 - relative norm of residual on 6 iteration: 1.86945e-05 - absolute norm of residual on 6 iteration: 0.000149556 - - Preconditioned CG process has successfully converged in absolute error in 6 steps with - relative error ||r||_2 / ||r_0||_2 = 1.86945e-05 > 1e-05 - absolute error ||r||_2 = 0.000149556 < 0.0005 - - Running with double precision real data type: - - sparse PCG parameters: - A size: (4096, 4096) - Preconditioner = Symmetric Gauss-Seidel - max iterations = 500 - relative tolerance limit = 1e-05 - absolute tolerance limit = 0.0005 - relative norm of residual on 1 iteration: 0.178532 - relative norm of residual on 2 iteration: 0.0280123 - relative norm of residual on 3 iteration: 0.0048948 - relative norm of residual on 4 iteration: 0.000796108 - relative norm of residual on 5 iteration: 0.000119025 - relative norm of residual on 6 iteration: 1.86945e-05 - absolute norm of residual on 6 iteration: 0.000149556 - - Preconditioned CG process has successfully converged in absolute error in 6 steps with - relative error ||r||_2 / ||r_0||_2 = 1.86945e-05 > 1e-05 - absolute error ||r||_2 = 0.000149556 < 0.0005 - -``` - -and the second PCG implementation with device side coefficients: -``` -./sparse_cg2 -######################################################################## -# Sparse Preconditioned Conjugate Gradient Solver with USM 2 -# -# Uses the preconditioned conjugate gradient algorithm to -# iteratively solve the symmetric linear system -# -# A * x = b -# -# where A is a symmetric sparse matrix in CSR format, and -# x and b are dense vectors. -# -# Uses the symmetric Gauss-Seidel preconditioner. -# -# alpha and beta constants in PCG algorithm are kept -# device side. -# -######################################################################## - -Running tests on Intel(R) Data Center GPU Max 1550. - Running with single precision real data type: - - sparse PCG parameters: - A size: (4096, 4096) - Preconditioner = Symmetric Gauss-Seidel - max iterations = 500 - relative tolerance limit = 1e-05 - absolute tolerance limit = 0.0005 - relative norm of residual on 1 iteration: 0.178532 - relative norm of residual on 2 iteration: 0.0280123 - relative norm of residual on 3 iteration: 0.0048948 - relative norm of residual on 4 iteration: 0.000796109 - relative norm of residual on 5 iteration: 0.000119025 - relative norm of residual on 6 iteration: 1.86945e-05 - absolute norm of residual on 6 iteration: 0.000149556 - - Preconditioned CG process has successfully converged in absolute error in 6 steps with - relative error ||r||_2 / ||r_0||_2 = 1.86945e-05 > 1e-05 - absolute error ||r||_2 = 0.000149556 < 0.0005 - - Running with double precision real data type: - - sparse PCG parameters: - A size: (4096, 4096) - Preconditioner = Symmetric Gauss-Seidel - max iterations = 500 - relative tolerance limit = 1e-05 - absolute tolerance limit = 0.0005 - relative norm of residual on 1 iteration: 0.178532 - relative norm of residual on 2 iteration: 0.0280123 - relative norm of residual on 3 iteration: 0.0048948 - relative norm of residual on 4 iteration: 0.000796108 - relative norm of residual on 5 iteration: 0.000119025 - relative norm of residual on 6 iteration: 1.86945e-05 - absolute norm of residual on 6 iteration: 0.000149556 - - Preconditioned CG process has successfully converged in absolute error in 6 steps with - relative error ||r||_2 / ||r_0||_2 = 1.86945e-05 > 1e-05 - absolute error ||r||_2 = 0.000149556 < 0.0005 - -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/makefile b/Libraries/oneMKL/sparse_conjugate_gradient/makefile deleted file mode 100644 index 14a949b10b..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/makefile +++ /dev/null @@ -1,23 +0,0 @@ -# Makefile for NMAKE - -default: run - -all: run - -run: sparse_cg.exe sparse_cg2.exe - .\sparse_cg - .\sparse_cg2 - -SYCL_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl="blas,sparse" /EHsc -fsycl-device-code-split=per_kernel OpenCL.lib - -sparse_cg.exe: sparse_cg.cpp - icx-cl -fsycl sparse_cg.cpp /Fesparse_cg.exe $(SYCL_OPTS) - -sparse_cg2.exe: sparse_cg2.cpp - icx-cl -fsycl sparse_cg2.cpp /Fesparse_cg2.exe $(SYCL_OPTS) - -clean: - del /q sparse_cg.exe sparse_cg.exp sparse_cg.lib - del /q sparse_cg2.exe sparse_cg2.exp sparse_cg2.lib - -pseudo: clean run all diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/sample.json b/Libraries/oneMKL/sparse_conjugate_gradient/sample.json deleted file mode 100644 index 018b532ece..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "3814C3C8-6CD1-40C9-A94B-CB4D4F58E2B9", - "name": "Sparse Conjugate Gradient", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Solve Sparse linear systems with the Conjugate Gradient method using Intel® oneMKL Sparse BLAS", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "sparse_conjugate_gradient", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "sparse_conjugate_gradient", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Concepts and Functionality" -} diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp b/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp deleted file mode 100644 index f44bfc8c95..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg.cpp +++ /dev/null @@ -1,592 +0,0 @@ -//============================================================== -// Copyright © 2024 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This example demonstrates use of oneAPI Math Kernel Library (oneMKL) -* SPARSE BLAS and BLAS USM APIs to solve a system of linear equations (Ax=b) -* by preconditioned Conjugate Gradient (PCG) method with the Symmetric -* Gauss-Seidel preconditioner: -* -* Solve A*x = b -* -* x_0 initial guess -* r_0 = b - A*x_0 -* k = 0 -* while (||r_k|| / ||r_0|| > relTol and k < maxIter ) -* -* solve M*z_k = r_k for z_k -* if (k == 0) -* p_1 = z_0 -* else -* beta_k = dot(r_k, z_k) / dot(r_{k-1}, z_{k-1}) -* p_{k+1} = z_k + beta_k * p_k -* end if -* Ap_{k+1} = A*p_{k+1} -* alpha_{k+1} = (r_k, z_k) / (p_{k+1}, Ap_{k+1}) -* -* x_{k+1} = x_k + alpha_{k+1} * p_{k+1} -* r_{k+1} = r_k - alpha_{k+1} * Ap_{k+1} -* if (||r_k|| < absTol) break with convergence -* -* k=k+1 -* end -* -* where A = L+D+L^T is in CSR format and the preconditioner -* is M = (D+L)*D^{-1}*(D+L^T). -* -* Note that: -* -* x is the solution -* r is the residual -* z is the preconditioned residual -* p is the search direction -* -* and we are using ||r||_2 for stopping criteria and alpha/beta scalars are -* provided as constants from host side. -* -* -* The supported floating point data types for gemm matrix data are: -* float -* double -* -*/ - -// stl includes -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -#include "utils.hpp" - -using namespace oneapi; - -template -class extractDiagonalClass; - -template -class modifyDiagonalClass; - -template -class diagonalMVClass; - -template -class noPreconClass; - -template -class jacobiPreconClass; - - -// -// extract diagonal from matrix -// -template -sycl::event extract_diagonal(sycl::queue q, - const intType n, - const intType *ia_d, - const intType *ja_d, - const dataType *a_d, - dataType *d_d, - dataType *invd_d, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - for (intType i = ia_d[row]; i < ia_d[row + 1]; i++) { - if (ja_d[i] == row) { - dataType diagVal = a_d[i]; - d_d[row] = diagVal; - invd_d[row] = dataType(1.0) / diagVal; - break; - } - } - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - -// -// Modify diagonal value in matrix -// -template -sycl::event modify_diagonal(sycl::queue q, - const dataType new_diagVal, - const intType n, - const intType *ia_d, - const intType *ja_d, - dataType *a_d, // to be modified - dataType *d_d, // to be modified - dataType *invd_d, // to be modified - const std::vector &deps = {}) -{ - assert(new_diagVal != dataType(0.0) ); - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - for (intType i = ia_d[row]; i < ia_d[row + 1]; i++) { - if (ja_d[i] == row) { - a_d[i] = new_diagVal; - d_d[row] = new_diagVal; - invd_d[row] = dataType(1.0) / new_diagVal; - break; - } - } - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// Scale by diagonal -// -// t = D * t -// -template -sycl::event diagonal_mv(sycl::queue q, - const intType n, - const dataType *d, - dataType *t, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - t[row] *= d[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// No Preconditioner -// -// solve M z = r where M = Identity -// z = r; -// -template -sycl::event precon_none(sycl::queue q, - const intType n, - const dataType *r, - dataType *z, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - z[row] = r[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// Jacobi Preconditioner -// -// solve M z = r where M = D = diag(a_00, a_11, a_22, ...) -// -// z = inv(D) * r; -// -template -sycl::event precon_jacobi(sycl::queue q, - const intType n, - oneapi::mkl::sparse::matrix_handle_t A, - const dataType *invd, - const dataType *r, - dataType *z, // output - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - z[row] = invd[row] * r[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// Gauss-Seidel Preconditioner -// -// solve M z = r where M = (L+D)*inv(D)*(D+U) -// -// t = inv(D+L) * r; // forward triangular solve -// t = D*t // diagonal mv -// z = inv(D+U) * t // backward triangular solve -// -template -sycl::event precon_gauss_seidel(sycl::queue q, - const intType n, - oneapi::mkl::sparse::matrix_handle_t A, - const dataType *d, - const dataType *r, - dataType *t, // temporary workspace - dataType *z, // output - const std::vector &deps = {}) -{ - - auto ev_trsvL = oneapi::mkl::sparse::trsv(q, oneapi::mkl::uplo::lower, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, dataType(1.0) /* alpha */, A, r, t, deps); - auto ev_diagmv = diagonal_mv(q, n, d, t, {ev_trsvL}); - auto ev_trsvU = oneapi::mkl::sparse::trsv(q, oneapi::mkl::uplo::upper, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, dataType(1.0) /* alpha */, A, t, z, {ev_diagmv}); - - return ev_trsvU; -} - - - -template -int run_sparse_pcg_example(const sycl::device &dev) -{ - - int good = 0; - - // Matrix data size - const intType size = 16; - const intType n = size * size * size; // A is n x n - - const intType nnzUB = 27 * n; // upper bound of nnz from 27 point stencil - - // PCG settings - const intType maxIter = 500; - const dataType relTol = 1.0e-5; - const dataType absTol = 5.0e-4; - - // Catch asynchronous exceptions - auto exception_handler = [](sycl::exception_list exceptions) { - for (std::exception_ptr const &e : exceptions) { - try { - std::rethrow_exception(e); - } - catch (sycl::exception const &e) { - std::cout << "Caught asynchronous SYCL " - "exception during sparse CG:\n" - << e.what() << std::endl; - } - } - }; - - // create queue around device - sycl::queue q(dev, exception_handler); - - - // Input matrix in CSR format - intType *ia_h = sycl::malloc_host(n+1, q); - intType *ja_h = sycl::malloc_host(nnzUB, q); - dataType *a_h = sycl::malloc_host(nnzUB, q); - dataType *x_h = sycl::malloc_host(n, q); - dataType *b_h = sycl::malloc_host(n, q); - - if (!ia_h || !ja_h || !a_h || !x_h || !b_h ) { - throw std::runtime_error("Failed to allocate host side USM memory"); - } - - // - // Generate a 27 point stencil for 3D laplacian using size elements in each dimension - // - generate_sparse_matrix(size, ia_h, ja_h, a_h); - - // Init right hand side and vector x - for (int i = 0; i < n; i++) { - b_h[i] = set_fp_value(dataType(1.0), dataType(0.0)); // rhs b = 1 - x_h[i] = set_fp_value(dataType(0.0), dataType(0.0)); // initial guess x0 = 0 - } - - // - // Execute Preconditioned Conjugate Gradient Algorithm - // - // solve A x = b starting with initial guess x = x0 - // - - std::cout << "\n\t\tsparse PCG parameters:\n"; - - std::cout << "\t\t\tA size: (" << n << ", " << n << ")" << std::endl; - std::cout << "\t\t\tPreconditioner = Symmetric Gauss-Seidel" << std::endl; - std::cout << "\t\t\tmax iterations = " << maxIter << std::endl; - std::cout << "\t\t\trelative tolerance limit = " << relTol << std::endl; - std::cout << "\t\t\tabsolute tolerance limit = " << absTol << std::endl; - - - const intType nnz = ia_h[n]; // assumes zero indexing - - // create arrays for help - intType *ia_d = sycl::malloc_device(n+1, q); // matrix rowptr - intType *ja_d = sycl::malloc_device(nnz, q); // matrix columns - dataType *a_d = sycl::malloc_device(nnz, q); // matrix values - dataType *x_d = sycl::malloc_device(n, q); // solution - dataType *b_d = sycl::malloc_device(n, q); // right hand side - dataType *r_d = sycl::malloc_device(n, q); // residual - dataType *z_d = sycl::malloc_device(n, q); // preconditioned residual - dataType *p_d = sycl::malloc_device(n, q); // search direction - dataType *t_d = sycl::malloc_device(n, q); // helper array - dataType *d_d = sycl::malloc_device(n, q); // matrix diagonals - dataType *invd_d = sycl::malloc_device(n, q); // matrix reciprocal of diagonals - - const intType width = 8; // width * sizeof(dataType) >= cacheline size (64 Bytes) - dataType *temp_d = sycl::malloc_device(3*width, q); - dataType *temp_h = sycl::malloc_host(3*width, q); - - if ( !ia_d || !ja_d || !a_d || !x_d || !b_d || !z_d || !p_d || !t_d || !d_d || !invd_d || !temp_d || !temp_h) { - throw std::runtime_error("Failed to allocate device side USM memory"); - } - - // device side aliases scattered by width elements each - dataType *normr_h = temp_h; - dataType *rtz_h = temp_h+1*width; - dataType *pAp_h = temp_h+2*width; - dataType *normr_d = temp_d; - dataType *rtz_d = temp_d+1*width; - dataType *pAp_d = temp_d+2*width; - - // copy data from host to device arrays - q.copy(ia_h, ia_d, n+1).wait(); - q.copy(ja_h, ja_d, nnz).wait(); - q.copy(a_h, a_d, nnz).wait(); - q.copy(x_h, x_d, n).wait(); - q.copy(b_h, b_d, n).wait(); - - extract_diagonal(q,n, ia_d, ja_d, a_d, d_d, invd_d, {}).wait(); - - // make the matrix diagonally dominant - modify_diagonal(q, dataType(52.0), n, ia_d, ja_d, a_d, d_d, invd_d, {}).wait(); - - // create and initialize handle for a Sparse Matrix in CSR format - oneapi::mkl::sparse::matrix_handle_t A = nullptr; - - try { - // setup optimizations and properties we know about A matrix - oneapi::mkl::sparse::init_matrix_handle(&A); - -#if (INTEL_MKL_VERSION < 20250300) - auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, - oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); -#else - auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, nnz, - oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); -#endif - - oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::symmetric); - oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::sorted); - - auto ev_optSvL = oneapi::mkl::sparse::optimize_trsv(q, - oneapi::mkl::uplo::lower, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, A, {ev_set}); - auto ev_optSvU = oneapi::mkl::sparse::optimize_trsv(q, - oneapi::mkl::uplo::upper, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, A, {ev_optSvL}); - auto ev_optGemv = oneapi::mkl::sparse::optimize_gemv(q, - oneapi::mkl::transpose::nontrans, A, {ev_optSvU}); - // done setting up optimizations for A matrix - - // initial residual r_0 = b - A * x_0 - auto ev_r = oneapi::mkl::sparse::gemv(q, oneapi::mkl::transpose::nontrans, 1.0, A, - x_d, 0.0, r_d, {ev_optGemv}); // r := A * x - - ev_r = oneapi::mkl::blas::axpby(q, n, 1.0, b_d, 1, -1.0, r_d, 1, {ev_r}); // r := 1 * b + -1 * r - - auto ev_normr = oneapi::mkl::blas::nrm2(q, n, r_d, 1, normr_d, {ev_r}); - dataType oldrTz = 0.0, rTz = 0.0, pAp = 0.0, normr = 0.0, normr_0 = 0.0; - { - q.copy(normr_d, normr_h, 12, {ev_normr}).wait(); - normr = std::sqrt(normr_h[0]); - normr_0 = normr; - } - - sycl::event ev_z, ev_rtz, ev_p, ev_Ap, ev_pAp, ev_x; - - std::int32_t k = 0; - while ( normr / normr_0 > relTol && k < maxIter) { - - // Calculation z_k = M^{-1}r_k - //ev_z = precon_none(q, n, r_d, z_d, {ev_r}); - //ev_z = precon_jacobi(q, n, A, invd_d, r_d, z_d, {ev_r}); - ev_z = precon_gauss_seidel(q, n, A, d_d, r_d, t_d, z_d, {ev_r}); - - if (k == 0 ) { - ev_rtz = oneapi::mkl::blas::dot(q, n, r_d, 1, z_d, 1, rtz_d, {ev_r, ev_z}); - { - q.copy(rtz_d, rtz_h, 1, {ev_rtz}).wait(); // synch point - rTz = rtz_h[0]; - } - - // copy D2D: p_1 = z_0 - ev_p = oneapi::mkl::blas::copy(q, n, z_d, 1, p_d, 1, {ev_z, ev_rtz}); - } - else { - // beta_{k+1} = dot(r_k, z_k) / dot(r_{k-1}, z_{k-1}) - ev_rtz = oneapi::mkl::blas::dot(q, n, r_d, 1, z_d, 1, rtz_d, {ev_r, ev_z}); - { - q.copy(rtz_d, rtz_h, 1, {ev_rtz}).wait(); // synch point - oldrTz = rTz; - rTz = rtz_h[0]; - } - - // Calculate p_{k+1} = z_{k+1} + beta_{k+1} * p_k - ev_p = oneapi::mkl::blas::axpby(q, n, 1.0, z_d, 1, rTz / oldrTz, p_d, 1, {ev_rtz}); - - } - - // Calculate Ap_{k+1} = A*p_{k+1} - ev_Ap = oneapi::mkl::sparse::gemv(q, oneapi::mkl::transpose::nontrans, - 1.0, A, p_d, 0.0, t_d, {ev_p}); - - // alpha_{k+1} = dot(r_k, z_k) / dot(p_{k+1}, Ap_{k+1}) - ev_pAp = oneapi::mkl::blas::dot(q, n, p_d, 1, t_d, 1, pAp_d, {ev_Ap}); - { - q.copy(pAp_d, pAp_h, 1, {ev_pAp}).wait(); // synch point - pAp = pAp_h[0]; - } - - // Calculate x_{k+1} = x_k + alpha_{k+1}*p_{k+1} - ev_x = oneapi::mkl::blas::axpy(q, n, rTz / pAp, p_d, 1, x_d, 1, {}); - - // Calculate r_{k+1} = r_k - alpha_{k+1}*Ap_{k+1} (note that t = A*p_{k+1} right now so it can be reused here) - ev_r = oneapi::mkl::blas::axpy(q, n, -rTz / pAp, t_d, 1, r_d, 1, {}); - - // temp_d = ||r_{k+1}||^2 - ev_normr = oneapi::mkl::blas::nrm2(q, n, z_d, 1, normr_d, {ev_r}); - { - q.copy(normr_d, normr_h, 1, {ev_normr}).wait(); // synch point - normr = std::sqrt(normr_h[0]); - } - - k++; // increment k counter - std::cout << "\t\t\t\trelative norm of residual on " << std::setw(4) << k // output in 1 base indexing - << " iteration: " << normr / normr_0 << std::endl; - if (normr <= absTol) { - std::cout << "\t\t\t\tabsolute norm of residual on " << std::setw(4) << k // output in 1-based indexing - << " iteration: " << normr << std::endl; - break; - } - - } // while normr / normr_0 > relTol && k < maxIter - - if (normr < absTol) { - std::cout << "" << std::endl; - std::cout << "\t\tPreconditioned CG process has successfully converged in absolute error in " << std::setw(4) << k << " steps with" << std::endl; - good = 1; - } - else if (k <= maxIter && normr / normr_0 <= relTol) { - std::cout << "" << std::endl; - std::cout << "\t\tPreconditioned CG process has successfully converged in relative error in " << std::setw(4) << k << " steps with" << std::endl; - good = 1; - } else { - std::cout << "" << std::endl; - std::cout << "\t\tPreconditioned CG process has not converged after " << k << " steps with" << std::endl; - good = 0; - } - - std::cout << "\t\t relative error ||r||_2 / ||r_0||_2 = " << normr / normr_0 << (normr / normr_0 < relTol ? " < " : " > ") << relTol << std::endl; - std::cout << "\t\t absolute error ||r||_2 = " << normr << (normr < absTol ? " < " : " > ") << absTol << std::endl; - std::cout << "" << std::endl; - - oneapi::mkl::sparse::release_matrix_handle(q, &A, {}).wait(); - } - catch (sycl::exception const &e) { - std::cout << "\t\tCaught synchronous SYCL exception:\n" << e.what() << std::endl; - - q.wait(); - oneapi::mkl::sparse::release_matrix_handle(q, &A).wait(); - return 1; - } - catch (std::exception const &e) { - std::cout << "\t\tCaught std exception:\n" << e.what() << std::endl; - - q.wait(); - oneapi::mkl::sparse::release_matrix_handle(q, &A).wait(); - return 1; - } - - q.wait(); - - // clean up USM memory allocations - sycl::free(ia_h, q); - sycl::free(ja_h, q); - sycl::free(a_h, q); - sycl::free(x_h, q); - sycl::free(b_h, q); - sycl::free(ia_d, q); - sycl::free(ja_d, q); - sycl::free(a_d, q); - sycl::free(x_d, q); - sycl::free(b_d, q); - sycl::free(r_d, q); - sycl::free(z_d, q); - sycl::free(p_d, q); - sycl::free(t_d, q); - sycl::free(d_d, q); - sycl::free(invd_d, q); - sycl::free(temp_d, q); - sycl::free(temp_h, q); - - return good ? 0 : 1; -} - - - -// -// Description of example setup, apis used and supported floating point type -// precisions -// -void print_banner() -{ - - std::cout << "###############################################################" - "#########\n" - "# Sparse Preconditioned Conjugate Gradient Solver with USM\n" - "# \n" - "# Uses the preconditioned conjugate gradient algorithm to\n" - "# iteratively solve the symmetric linear system\n" - "# \n" - "# A * x = b\n" - "# \n" - "# where A is a symmetric sparse matrix in CSR format, and\n" - "# x and b are dense vectors.\n" - "# \n" - "# Uses the symmetric Gauss-Seidel preconditioner.\n" - "# \n" - "# alpha and beta constants in PCG algorithm are host side.\n" - "# \n" - "###############################################################" - "#########\n\n"; -} - -int main(int argc, char **argv) -{ - print_banner(); - - sycl::device my_dev{sycl::default_selector_v}; - - std::cout << "Running tests on " << my_dev.get_info() << ".\n"; - - std::cout << "\tRunning with single precision real data type:" << std::endl; - run_sparse_pcg_example(my_dev); - - if (my_dev.get_info().size() != 0) { - std::cout << "\tRunning with double precision real data type:" << std::endl; - run_sparse_pcg_example(my_dev); - } -} diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp b/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp deleted file mode 100644 index 48a8deb043..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/sparse_cg2.cpp +++ /dev/null @@ -1,655 +0,0 @@ -//============================================================== -// Copyright © 2024 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* -* -* Content: -* This example demonstrates use of oneAPI Math Kernel Library (oneMKL) -* SPARSE BLAS and BLAS USM APIs to solve a system of linear equations (Ax=b) -* by preconditioned Conjugate Gradient (PCG) method with the Symmetric -* Gauss-Seidel preconditioner: -* -* Solve A*x = b -* -* x_0 initial guess -* r_0 = b - A*x_0 -* k = 0 -* while (||r_k|| / ||r_0|| > relTol and k < maxIter ) -* -* solve M*z_k = r_k for z_k -* if (k == 0) -* p_1 = z_0 -* else -* beta_k = dot(r_k, z_k) / dot(r_{k-1}, z_{k-1}) -* p_{k+1} = z_k + beta_k * p_k -* end if -* Ap_{k+1} = A*p_{k+1} -* alpha_{k+1} = (r_k, z_k) / (p_{k+1}, Ap_{k+1}) -* -* x_{k+1} = x_k + alpha_{k+1} * p_{k+1} -* r_{k+1} = r_k - alpha_{k+1} * Ap_{k+1} -* if (||r_k|| < absTol) break with convergence -* -* k=k+1 -* end -* -* where A = L+D+L^T is in CSR format and the preconditioner -* is M = (D+L)*D^{-1}*(D+L^T). -* -* Note that: -* -* x is the solution -* r is the residual -* z is the preconditioned residual -* p is the search direction -* -* and we are using ||r||_2 for stopping criteria and alpha/beta scalars are -* kept on device side to avoid unnecessary synchronization points. -* -* Note, this example differs from the solver_cg2.cpp sample in that we define -* our own custom axpby and axpy that can take in multiple device side scalars for -* construction of alpha/beta from device side on-the-fly to avoid unnecessary synch -* points on host for alpha/beta construction. -* -* -* The supported floating point data types for gemm matrix data are: -* float -* double -* -*/ - -// stl includes -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "oneapi/mkl.hpp" - -#include "utils.hpp" - -using namespace oneapi; - -template -class extractDiagonalClass; - -template -class modifyDiagonalClass; - -template -class diagonalMVClass; - -template -class noPreconClass; - -template -class jacobiPreconClass; - -template -class axpby2Class; - -template -class axpy3Class; - - - -// -// extract diagonal from matrix -// -template -sycl::event extract_diagonal(sycl::queue q, - const intType n, - const intType *ia_d, - const intType *ja_d, - const dataType *a_d, - dataType *d_d, - dataType *invd_d, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - for (intType i = ia_d[row]; i < ia_d[row + 1]; i++) { - if (ja_d[i] == row) { - dataType diagVal = a_d[i]; - d_d[row] = diagVal; - invd_d[row] = dataType(1.0) / diagVal; - break; - } - } - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - -// -// Modify diagonal value in matrix -// -template -sycl::event modify_diagonal(sycl::queue q, - const dataType new_diagVal, - const intType n, - const intType *ia_d, - const intType *ja_d, - dataType *a_d, // to be modified - dataType *d_d, // to be modified - dataType *invd_d, // to be modified - const std::vector &deps = {}) -{ - assert(new_diagVal != dataType(0.0) ); - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - for (intType i = ia_d[row]; i < ia_d[row + 1]; i++) { - if (ja_d[i] == row) { - a_d[i] = new_diagVal; - d_d[row] = new_diagVal; - invd_d[row] = dataType(1.0) / new_diagVal; - break; - } - } - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// Scale by diagonal -// -// t = D * t -// -template -sycl::event diagonal_mv(sycl::queue q, - const intType n, - const dataType *d, - dataType *t, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - t[row] *= d[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// No Preconditioner -// -// solve M z = r where M = Identity -// z = r; -// -template -sycl::event precon_none(sycl::queue q, - const intType n, - const dataType *r, - dataType *z, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - z[row] = r[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// Jacobi Preconditioner -// -// solve M z = r where M = D = diag(a_00, a_11, a_22, ...) -// -// z = inv(D) * r; -// -template -sycl::event precon_jacobi(sycl::queue q, - const intType n, - oneapi::mkl::sparse::matrix_handle_t A, - const dataType *invd, - const dataType *r, - dataType *z, // output - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - z[row] = invd[row] * r[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); -} - - -// -// Gauss-Seidel Preconditioner -// -// solve M z = r where M = (L+D)*inv(D)*(D+U) -// -// t = inv(D+L) * r; // forward triangular solve -// t = D*t // diagonal mv -// z = inv(D+U) * t // backward triangular solve -// -template -sycl::event precon_gauss_seidel(sycl::queue q, - const intType n, - oneapi::mkl::sparse::matrix_handle_t A, - const dataType *d, - const dataType *r, - dataType *t, // temporary workspace - dataType *z, // output - const std::vector &deps = {}) -{ - - auto ev_trsvL = oneapi::mkl::sparse::trsv(q, oneapi::mkl::uplo::lower, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, dataType(1.0) /* alpha */, A, r, t, deps); - auto ev_diagmv = diagonal_mv(q, n, d, t, {ev_trsvL}); - auto ev_trsvU = oneapi::mkl::sparse::trsv(q, oneapi::mkl::uplo::upper, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, dataType(1.0) /* alpha */, A, t, z, {ev_diagmv}); - - return ev_trsvU; -} - - -// -// AXPBY2: -// -// Calculate y = alpha * x + beta1 / beta2 * y -// -// where beta1 and beta2 are device side arrays with scalar value in 0th element -// -template -sycl::event axpby2(sycl::queue q, - const intType n, - const dataType alpha, - const dataType *x, - const dataType *beta1_d, - const dataType *beta2_d, - dataType *y, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - - const dataType beta = beta1_d[0] / beta2_d[0]; - y[row] = alpha * x[row] + beta * y[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); - -} - -// -// AXPY3: -// -// Calculate y = scale * alpha1 / alpha2 * x + y -// -// where alpha1 and alpha2 may be device side arrays with scalar value in 0th element -// -template -sycl::event axpy3(sycl::queue q, - const intType n, - const dataType scale, - const dataType *alpha1_d, - const dataType *alpha2_d, - const dataType *x, - dataType *y, - const std::vector &deps = {}) -{ - return q.submit([&](sycl::handler &cgh) { - cgh.depends_on(deps); - auto kernel = [=](sycl::item<1> item) { - const int row = item.get_id(0); - const dataType alpha = scale * alpha1_d[0] / alpha2_d[0]; - y[row] = alpha * x[row] + y[row]; - }; - cgh.parallel_for>(sycl::range<1>(n), kernel); - }); - -} - - - - - -template -int run_sparse_pcg_example(const sycl::device &dev) -{ - - int good = 0; - - // Matrix data size - const intType size = 16; - const intType n = size * size * size; // A is n x n - - const intType nnzUB = 27 * n; // upper bound of nnz from 27 point stencil - - // PCG settings - const intType maxIter = 500; - const dataType relTol = 1.0e-5; - const dataType absTol = 5.0e-4; - - // Catch asynchronous exceptions - auto exception_handler = [](sycl::exception_list exceptions) { - for (std::exception_ptr const &e : exceptions) { - try { - std::rethrow_exception(e); - } - catch (sycl::exception const &e) { - std::cout << "Caught asynchronous SYCL " - "exception during sparse CG:\n" - << e.what() << std::endl; - } - } - }; - - // create queue around device - sycl::queue q(dev, exception_handler); - - - // Input matrix in CSR format - intType *ia_h = sycl::malloc_host(n+1, q); - intType *ja_h = sycl::malloc_host(nnzUB, q); - dataType *a_h = sycl::malloc_host(nnzUB, q); - dataType *x_h = sycl::malloc_host(n, q); - dataType *b_h = sycl::malloc_host(n, q); - - if (!ia_h || !ja_h || !a_h || !x_h || !b_h ) { - throw std::runtime_error("Failed to allocate host side USM memory"); - } - - // - // Generate a 27 point stencil for 3D laplacian using size elements in each dimension - // - generate_sparse_matrix(size, ia_h, ja_h, a_h); - - // Init right hand side and vector x - for (int i = 0; i < n; i++) { - b_h[i] = set_fp_value(dataType(1.0), dataType(0.0)); // rhs b = 1 - x_h[i] = set_fp_value(dataType(0.0), dataType(0.0)); // initial guess x0 = 0 - } - - // - // Execute Preconditioned Conjugate Gradient Algorithm - // - // solve A x = b starting with initial guess x = x0 - // - - std::cout << "\n\t\tsparse PCG parameters:\n"; - - std::cout << "\t\t\tA size: (" << n << ", " << n << ")" << std::endl; - std::cout << "\t\t\tPreconditioner = Symmetric Gauss-Seidel" << std::endl; - std::cout << "\t\t\tmax iterations = " << maxIter << std::endl; - std::cout << "\t\t\trelative tolerance limit = " << relTol << std::endl; - std::cout << "\t\t\tabsolute tolerance limit = " << absTol << std::endl; - - - const intType nnz = ia_h[n]; // assumes zero indexing - - // create arrays for help - intType *ia_d = sycl::malloc_device(n+1, q); // matrix rowptr - intType *ja_d = sycl::malloc_device(nnz, q); // matrix columns - dataType *a_d = sycl::malloc_device(nnz, q); // matrix values - dataType *x_d = sycl::malloc_device(n, q); // solution - dataType *b_d = sycl::malloc_device(n, q); // right hand side - dataType *r_d = sycl::malloc_device(n, q); // residual - dataType *z_d = sycl::malloc_device(n, q); // preconditioned residual - dataType *p_d = sycl::malloc_device(n, q); // search direction - dataType *t_d = sycl::malloc_device(n, q); // helper array - dataType *d_d = sycl::malloc_device(n, q); // matrix diagonals - dataType *invd_d = sycl::malloc_device(n, q); // matrix reciprocal of diagonals - - const intType width = 8; // width * sizeof(dataType) >= cacheline size (64 Bytes) - dataType *temp_d = sycl::malloc_device(4*width, q); - dataType *temp_h = sycl::malloc_host(4*width, q); - - if ( !ia_d || !ja_d || !a_d || !x_d || !b_d || !z_d || !p_d || !t_d || !d_d || !invd_d || !temp_d || !temp_h) { - throw std::runtime_error("Failed to allocate device side USM memory"); - } - - // device side aliases scattered by width elements each - dataType *normr_h = temp_h; - dataType *normr_d = temp_d; - dataType *rtz_d = temp_d+1*width; - dataType *oldrtz_d = temp_d+2*width; - dataType *pAp_d = temp_d+3*width; - - // copy data from host to device arrays - q.copy(ia_h, ia_d, n+1).wait(); - q.copy(ja_h, ja_d, nnz).wait(); - q.copy(a_h, a_d, nnz).wait(); - q.copy(x_h, x_d, n).wait(); - q.copy(b_h, b_d, n).wait(); - - extract_diagonal(q,n, ia_d, ja_d, a_d, d_d, invd_d, {}).wait(); - - // make the matrix diagonally dominant - modify_diagonal(q, dataType(52.0), n, ia_d, ja_d, a_d, d_d, invd_d, {}).wait(); - - // create and initialize handle for a Sparse Matrix in CSR format - oneapi::mkl::sparse::matrix_handle_t A = nullptr; - - try { - // setup optimizations and properties we know about A matrix - oneapi::mkl::sparse::init_matrix_handle(&A); - -#if (INTEL_MKL_VERSION < 20250300) - auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, - oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); -#else - auto ev_set = oneapi::mkl::sparse::set_csr_data(q, A, n, n, nnz, - oneapi::mkl::index_base::zero, ia_d, ja_d, a_d, {}); -#endif - - oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::symmetric); - oneapi::mkl::sparse::set_matrix_property(A, oneapi::mkl::sparse::property::sorted); - - auto ev_optSvL = oneapi::mkl::sparse::optimize_trsv(q, - oneapi::mkl::uplo::lower, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, A, {ev_set}); - auto ev_optSvU = oneapi::mkl::sparse::optimize_trsv(q, - oneapi::mkl::uplo::upper, oneapi::mkl::transpose::nontrans, - oneapi::mkl::diag::nonunit, A, {ev_optSvL}); - auto ev_optGemv = oneapi::mkl::sparse::optimize_gemv(q, - oneapi::mkl::transpose::nontrans, A, {ev_optSvU}); - // done setting up optimizations for A matrix - - // initial residual r_0 = b - A * x_0 - auto ev_r = oneapi::mkl::sparse::gemv(q, oneapi::mkl::transpose::nontrans, 1.0, A, - x_d, 0.0, r_d, {ev_optGemv}); // r := A * x - - ev_r = oneapi::mkl::blas::axpby(q, n, 1.0, b_d, 1, -1.0, r_d, 1, {ev_r}); // r := 1 * b + -1 * r - - auto ev_normr = oneapi::mkl::blas::nrm2(q, n, r_d, 1, normr_d, {ev_r}); - dataType normr = 0.0, normr_0 = 0.0; - { - q.copy(normr_d, normr_h, 12, {ev_normr}).wait(); - normr = std::sqrt(normr_h[0]); - normr_0 = normr; - } - - sycl::event ev_z, ev_rtz, ev_p, ev_Ap, ev_pAp, ev_x; - - std::int32_t k = 0; - while ( normr / normr_0 > relTol && k < maxIter) { - - // Calculation z_k = M^{-1}r_k - //ev_z = precon_none(q, n, r_d, z_d, {ev_r}); - //ev_z = precon_jacobi(q, n, A, invd_d, r_d, z_d, {ev_r}); - ev_z = precon_gauss_seidel(q, n, A, d_d, r_d, t_d, z_d, {ev_r}); - - if (k == 0 ) { - ev_rtz = oneapi::mkl::blas::dot(q, n, r_d, 1, z_d, 1, rtz_d, {ev_r, ev_z}); - - // copy D2D: p_1 = z_0 - ev_p = oneapi::mkl::blas::copy(q, n, z_d, 1, p_d, 1, {ev_z, ev_rtz}); - } - else { - auto ev_oldrtz = q.copy(rtz_d, oldrtz_d, 1, {ev_z}); - - // beta_{k+1} = dot(r_k, z_k) / dot(r_{k-1}, z_{k-1}) - ev_rtz = oneapi::mkl::blas::dot(q, n, r_d, 1, z_d, 1, rtz_d, {ev_r, ev_z, ev_oldrtz}); - - // Calculate p_{k+1} = z_{k+1} + beta_{k+1} * p_k - ev_p = axpby2(q, n, dataType(1.0), z_d, rtz_d, oldrtz_d, p_d, {ev_rtz}); - - } - - // Calculate Ap_{k+1} = A*p_{k+1} - ev_Ap = oneapi::mkl::sparse::gemv(q, oneapi::mkl::transpose::nontrans, - 1.0, A, p_d, 0.0, t_d, {ev_p}); - - // alpha_{k+1} = dot(r_k, z_k) / dot(p_{k+1}, Ap_{k+1}) - ev_pAp = oneapi::mkl::blas::dot(q, n, p_d, 1, t_d, 1, pAp_d, {ev_Ap}); - - // Calculate x_{k+1} = x_k + alpha_{k+1}*p_{k+1} - ev_x = axpy3(q, n, dataType(1.0), rtz_d, pAp_d, p_d, x_d, {ev_pAp}); - - // Calculate r_{k+1} = r_k - alpha_{k+1}*Ap_{k+1} (note that t = A*p_{k+1} right now so it can be reused here) - ev_r = axpy3(q, n, dataType(-1.0), rtz_d, pAp_d, t_d, r_d, {ev_pAp}); - - // temp_d = ||r_{k+1}||^2 - ev_normr = oneapi::mkl::blas::nrm2(q, n, z_d, 1, normr_d, {ev_r}); - { - q.copy(normr_d, normr_h, 1, {ev_normr}).wait(); // synch point - normr = std::sqrt(normr_h[0]); - } - - k++; // increment k counter - std::cout << "\t\t\t\trelative norm of residual on " << std::setw(4) << k // output in 1 base indexing - << " iteration: " << normr / normr_0 << std::endl; - if (normr <= absTol) { - std::cout << "\t\t\t\tabsolute norm of residual on " << std::setw(4) << k // output in 1-based indexing - << " iteration: " << normr << std::endl; - break; - } - - } // while normr / normr_0 > relTol && k < maxIter - - if (normr < absTol) { - std::cout << "" << std::endl; - std::cout << "\t\tPreconditioned CG process has successfully converged in absolute error in " << std::setw(4) << k << " steps with" << std::endl; - good = 1; - } - else if (k <= maxIter && normr / normr_0 <= relTol) { - std::cout << "" << std::endl; - std::cout << "\t\tPreconditioned CG process has successfully converged in relative error in " << std::setw(4) << k << " steps with" << std::endl; - good = 1; - } else { - std::cout << "" << std::endl; - std::cout << "\t\tPreconditioned CG process has not converged after " << k << " steps with" << std::endl; - good = 0; - } - - std::cout << "\t\t relative error ||r||_2 / ||r_0||_2 = " << normr / normr_0 << (normr / normr_0 < relTol ? " < " : " > ") << relTol << std::endl; - std::cout << "\t\t absolute error ||r||_2 = " << normr << (normr < absTol ? " < " : " > ") << absTol << std::endl; - std::cout << "" << std::endl; - - oneapi::mkl::sparse::release_matrix_handle(q, &A, {}).wait(); - } - catch (sycl::exception const &e) { - std::cout << "\t\tCaught synchronous SYCL exception:\n" << e.what() << std::endl; - - q.wait(); - oneapi::mkl::sparse::release_matrix_handle(q, &A).wait(); - return 1; - } - catch (std::exception const &e) { - std::cout << "\t\tCaught std exception:\n" << e.what() << std::endl; - - q.wait(); - oneapi::mkl::sparse::release_matrix_handle(q, &A).wait(); - return 1; - } - - q.wait(); - - // clean up USM memory allocations - sycl::free(ia_h, q); - sycl::free(ja_h, q); - sycl::free(a_h, q); - sycl::free(x_h, q); - sycl::free(b_h, q); - sycl::free(ia_d, q); - sycl::free(ja_d, q); - sycl::free(a_d, q); - sycl::free(x_d, q); - sycl::free(b_d, q); - sycl::free(r_d, q); - sycl::free(z_d, q); - sycl::free(p_d, q); - sycl::free(t_d, q); - sycl::free(d_d, q); - sycl::free(invd_d, q); - sycl::free(temp_d, q); - sycl::free(temp_h, q); - - return good ? 0 : 1; -} - - - -// -// Description of example setup, apis used and supported floating point type -// precisions -// -void print_banner() -{ - - std::cout << "###############################################################" - "#########\n" - "# Sparse Preconditioned Conjugate Gradient Solver with USM 2\n" - "# \n" - "# Uses the preconditioned conjugate gradient algorithm to\n" - "# iteratively solve the symmetric linear system\n" - "# \n" - "# A * x = b\n" - "# \n" - "# where A is a symmetric sparse matrix in CSR format, and\n" - "# x and b are dense vectors.\n" - "# \n" - "# Uses the symmetric Gauss-Seidel preconditioner.\n" - "# \n" - "# alpha and beta constants in PCG algorithm are kept\n" - "# device side.\n" - "# \n" - "###############################################################" - "#########\n\n"; -} - -int main(int argc, char **argv) -{ - print_banner(); - - sycl::device my_dev{sycl::default_selector_v}; - - std::cout << "Running tests on " << my_dev.get_info() << ".\n"; - - std::cout << "\tRunning with single precision real data type:" << std::endl; - run_sparse_pcg_example(my_dev); - - if (my_dev.get_info().size() != 0) { - std::cout << "\tRunning with double precision real data type:" << std::endl; - run_sparse_pcg_example(my_dev); - } -} diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/third-party-programs.txt b/Libraries/oneMKL/sparse_conjugate_gradient/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Libraries/oneMKL/sparse_conjugate_gradient/utils.hpp b/Libraries/oneMKL/sparse_conjugate_gradient/utils.hpp deleted file mode 100644 index a57baf908d..0000000000 --- a/Libraries/oneMKL/sparse_conjugate_gradient/utils.hpp +++ /dev/null @@ -1,81 +0,0 @@ -//============================================================== -// Copyright © 2020 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -template fp rand_scalar() { - return fp(std::rand()) / fp(RAND_MAX) - fp(0.5); -} - -// -// helpers for initializing templated scalar data type values. -// -template -fp set_fp_value(fp arg1, fp arg2 = 0.0) -{ - return arg1; -} - -template -std::complex set_fp_value(std::complex arg1, std::complex arg2 = 0.0){ - return std::complex(arg1.real(), arg2.real()); -} - - -// Create the 3arrays CSR representation (ia, ja, values) -// initialized by a stencil-based matrix with size nx=ny=nz -// with 27 point finite difference stencil for the laplacian -template -void generate_sparse_matrix(const intType nx, - intType *ia, - intType *ja, - fp *a, - const intType index = 0) -{ - intType nz = nx, ny = nx; - intType nnz = 0; - intType current_row; - - ia[0] = index; - - for (intType iz = 0; iz < nz; iz++) { - for (intType iy = 0; iy < ny; iy++) { - for (intType ix = 0; ix < nx; ix++) { - - current_row = iz * nx * ny + iy * nx + ix; - - for (intType sz = -1; sz <= 1; sz++) { - if (iz + sz > -1 && iz + sz < nz) { - for (intType sy = -1; sy <= 1; sy++) { - if (iy + sy > -1 && iy + sy < ny) { - for (intType sx = -1; sx <= 1; sx++) { - if (ix + sx > -1 && ix + sx < nx) { - intType current_column = - current_row + sz * nx * ny + sy * nx + sx; - ja[nnz] = current_column + index; - if (current_column == current_row) { - a[nnz++] = set_fp_value(fp(26.0), fp(0.0)); - } - else { - a[nnz++] = set_fp_value(fp(-1.0), fp(0.0)); - } - } // end - // x - // bounds - // test - } // end sx loop - } // end y bounds test - } // end sy loop - } // end z bounds test - } // end sz loop - ia[current_row + 1] = nnz + index; - - } // end ix loop - } // end iy loop - } // end iz loop -} - - - - diff --git a/Libraries/oneMKL/student_t_test/GNUmakefile b/Libraries/oneMKL/student_t_test/GNUmakefile deleted file mode 100644 index c096c40221..0000000000 --- a/Libraries/oneMKL/student_t_test/GNUmakefile +++ /dev/null @@ -1,24 +0,0 @@ -# Makefile for GNU Make - -default: run - -all: run - -run: t_test t_test_usm - ./t_test - ./t_test_usm - -MKL_COPTS = -DMKL_ILP64 -qmkl -qmkl-sycl-impl="stats,rng" - -DPCPP_OPTS = $(MKL_COPTS) -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations - -t_test: t_test.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -t_test_usm: t_test_usm.cpp - icpx $< -fsycl -o $@ $(DPCPP_OPTS) - -clean: - -rm -f t_test t_test_usm - -.PHONY: clean run all diff --git a/Libraries/oneMKL/student_t_test/License.txt b/Libraries/oneMKL/student_t_test/License.txt deleted file mode 100644 index 0abc121bd7..0000000000 --- a/Libraries/oneMKL/student_t_test/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Intel Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Libraries/oneMKL/student_t_test/README.md b/Libraries/oneMKL/student_t_test/README.md deleted file mode 100644 index 8c8a298a48..0000000000 --- a/Libraries/oneMKL/student_t_test/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# `Student's T-test` Sample -The Student's T-test sample shows how to use the Intel® oneAPI Math Kernel Library (oneMKL) Vector Statistics functionality to decide if the null hypothesis should be accepted or rejected. - -| Optimized for | Description -|:--- |:--- -| OS | Linux* Ubuntu* 18.04
Windows* 10, 11 -| Hardware | Skylake with Gen9 or newer -| Software | Intel® oneAPI Math Kernel Library (oneMKL) -| What you will learn | How to use oneMKL Vector Statistics -| Time to complete | 15 minutes - -For more information on oneMKL and complete documentation of all oneMKL routines, see https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-documentation.html. - -## Purpose - -Student’s t-test, in statistics, a method of testing hypotheses about the mean of a small sample drawn from a normally distributed population when the population standard deviation is unknown. It is usually first to formulate a null hypothesis, which states that there is no effective difference between the observed sample mean and the hypothesized or stated population mean—i.e., that any measured difference is due only to chance. - -This sample uses the oneMKL Vector Statistics functionality to produce the random numbers and compute statistics. - -The computations of the Student's t-test sample are performed on the default SYCL* device. You can set the `SYCL_DEVICE_TYPE` environment variable to `cpu` or `gpu` to select the device to use. - - -## Key Implementation Details - -The student's t-test sample illustrates how to create an RNG engine object (the source of pseudo-randomness), a distribution object (specifying the desired probability distribution), and generate the random numbers themselves. After the numbers are produced, basic statistical properties such as mean and standard deviation are computed to be processed inside the Student's T-test algorithm. - -## Building the Student's T-test Sample - -### Using Visual Studio Code* (Optional) - -You can use Visual Studio Code (VS Code) extensions to set your environment, create launch configurations, -and browse and download samples. - -The basic steps to build and run a sample using VS Code include: - - Download a sample using the extension **Code Sample Browser for Intel Software Developer Tools**. - - Configure the oneAPI environment with the extension **Environment Configurator for Intel Software Developer Tools**. - - Open a Terminal in VS Code (**Terminal>New Terminal**). - - Run the sample in the VS Code terminal using the instructions below. - - (Linux only) Debug your GPU application with GDB for Intel® oneAPI toolkits using the **Generate Launch Configurations** extension. - -To learn more about the extensions, see the -[Using Visual Studio Code with Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/using-vs-code-with-intel-oneapi/top.html). - - -### On a Linux* System -Run `make` to build and run the sample. Two programs (t_test and t_test_usm) are generated, which illustrate different APIs for random number generation. - -You can remove all generated files with `make clean`. - -### On a Windows* System -Run `nmake` to build and run the sample. Two programs (t_test.exe and t_test_usm.exe) are generated, which illustrate different APIs for random number generation. - -You can remove all generated files with `nmake clean`. - -> **Warning**: On Windows, static linking with oneMKL currently takes a very long time, due to a known compiler issue. This will be addressed in an upcoming release. - -## Running the Student's T-test Sample -### Example of Output -If everything is working correctly, after running `make` (`nmake`) you will see step-by-step output from each of the two example programs, providing the decision about accepting null hypothesis. -``` -./t_test - -Student's T-test Simulation -Buffer Api -------------------------------------- -Number of random samples = 1000000 with mean = 0, std_dev = 1 -T-test result with expected mean: 1 -T-test result with two input arrays: 1 - -TEST PASSED - -./t_test_usm - -Student's T-test Simulation -Unified Shared Memory Api -------------------------------------- -Number of random samples = 1000000 with mean = 0, std_dev = 1 -T-test result with expected mean: 1 -T-test result with two input arrays: 1 - -TEST PASSED -``` - -### Troubleshooting -If an error occurs, troubleshoot the problem using the Diagnostics Utility for Intel® oneAPI Toolkits. -[Learn more](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html). - -## License - -Code samples are licensed under the MIT license. See -[License.txt](License.txt) for details. - -Third party program Licenses can be found here: [third-party-programs.txt](third-party-programs.txt). diff --git a/Libraries/oneMKL/student_t_test/makefile b/Libraries/oneMKL/student_t_test/makefile deleted file mode 100644 index 5292b875b2..0000000000 --- a/Libraries/oneMKL/student_t_test/makefile +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile for NMAKE - -default: run - -all: run - -run: t_test.exe t_test_usm.exe - .\t_test.exe - .\t_test_usm.exe - -DPCPP_OPTS=/I"$(MKLROOT)\include" /Qmkl /Qmkl-sycl-impl="stats,rng" /DMKL_ILP64 /EHsc -fsycl-device-code-split=per_kernel -fno-sycl-early-optimizations OpenCL.lib - -t_test.exe: t_test.cpp - icx-cl -fsycl t_test.cpp /Fet_test.exe $(DPCPP_OPTS) - -t_test_usm.exe: t_test_usm.cpp - icx-cl -fsycl t_test_usm.cpp /Fet_test_usm.exe $(DPCPP_OPTS) - -clean: - del /q t_test.exe t_test_usm.exe - -pseudo: clean run all diff --git a/Libraries/oneMKL/student_t_test/sample.json b/Libraries/oneMKL/student_t_test/sample.json deleted file mode 100644 index 31735c99cd..0000000000 --- a/Libraries/oneMKL/student_t_test/sample.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "guid": "ADD7BA78-BBFD-4390-A814-886CCC7971C1", - "name": "Student's T-test", - "categories": ["Toolkit/oneAPI Libraries/oneMKL"], - "description": "Performing Student's T-test with Intel® oneMKL Vector Statistics functionality", - "toolchain": [ "dpcpp" ], - "dependencies": [ "mkl" ], - "languages": [ { "cpp": { "properties": { "projectOptions": [ { "projectType": "makefile" } ] } } } ], - "targetDevice": [ "CPU", "GPU" ], - "os": [ "linux", "windows" ], - "builder": [ "make" ], - "ciTests": { - "linux": [ - { - "id": "t_test", - "steps": [ - "make clean", - "make" - ] - } - ], - "windows": [ - { - "id": "t_test", - "steps": [ - "nmake clean", - "nmake" - ] - } - ] - }, - "expertise": "Getting Started" -} diff --git a/Libraries/oneMKL/student_t_test/t_test.cpp b/Libraries/oneMKL/student_t_test/t_test.cpp deleted file mode 100644 index 22f98ba43d..0000000000 --- a/Libraries/oneMKL/student_t_test/t_test.cpp +++ /dev/null @@ -1,207 +0,0 @@ -//============================================================== -// Copyright © 2021 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* - * - * Content: - * This file contains Student's T-test DPC++ implementation with - * buffer APIs. - * - *******************************************************************************/ - -#include -#include -#include -#include - -#include "oneapi/mkl.hpp" - -// Initialization value for random number generator -static const int seed = 7777; -// Quantity of samples to check using Students' T-test -static const int n_samples = 1000000; -// Expected mean value of random samples -static const float expected_mean = 0.0f; -// Expected standard deviation of random samples -static const float expected_std_dev = 1.0f; -// T-test threshold which corresponds to 5% significance level and infinite -// degrees of freedom -static const float threshold = 1.95996f; - -// T-test function with expected mean -// Returns: -1 if something went wrong, 1 - in case of NULL hypothesis should be -// accepted, 0 - in case of NULL hypothesis should be rejected -template -std::int32_t t_test(sycl::queue &q, sycl::buffer &r, - std::int64_t n, RealType expected_mean) { - std::int32_t res = -1; - RealType sqrt_n_observations = std::sqrt(static_cast(n)); - - // Create buffers to be passed inside oneMKL stats functions - sycl::buffer mean_buf(sycl::range{1}); - sycl::buffer variance_buf(sycl::range{1}); - // Perform computations of mean and variance - auto dataset = - oneapi::mkl::stats::make_dataset( - 1, n, r); - oneapi::mkl::stats::mean(q, dataset, mean_buf); - q.wait_and_throw(); - oneapi::mkl::stats::central_moment(q, mean_buf, dataset, variance_buf); - q.wait_and_throw(); - // Create Host accessors and check the condition - sycl::host_accessor mean_acc(mean_buf); - sycl::host_accessor variance_acc(variance_buf); - if ((std::abs(mean_acc[0] - expected_mean) * sqrt_n_observations / - std::sqrt(variance_acc[0])) < static_cast(threshold)) { - res = 1; - } else { - res = 0; - } - return res; -} - -// T-test function with two input arrays -// Returns: -1 if something went wrong, 1 - in case of NULL hypothesis should be -// accepted, 0 - in case of NULL hypothesis should be rejected -template -std::int32_t t_test(sycl::queue &q, sycl::buffer &r1, - std::int64_t n1, sycl::buffer &r2, - std::int64_t n2) { - std::int32_t res = -1; - - // Create buffers to be passed inside oneMKL stats functions - sycl::buffer mean1_buf(sycl::range{1}); - sycl::buffer variance1_buf(sycl::range{1}); - sycl::buffer mean2_buf(sycl::range{1}); - sycl::buffer variance2_buf(sycl::range{1}); - // Perform computations of mean and variance - auto dataset1 = - oneapi::mkl::stats::make_dataset( - 1, n1, r1); - auto dataset2 = - oneapi::mkl::stats::make_dataset( - 1, n2, r2); - oneapi::mkl::stats::mean(q, dataset1, mean1_buf); - q.wait_and_throw(); - oneapi::mkl::stats::central_moment(q, mean1_buf, dataset1, variance1_buf); - oneapi::mkl::stats::mean(q, dataset2, mean2_buf); - q.wait_and_throw(); - oneapi::mkl::stats::central_moment(q, mean2_buf, dataset2, variance2_buf); - q.wait_and_throw(); - // Create Host accessors and check the condition - sycl::host_accessor mean1_acc{mean1_buf}; - sycl::host_accessor variance1_acc{variance1_buf}; - sycl::host_accessor mean2_acc{mean2_buf}; - sycl::host_accessor variance2_acc{variance2_buf}; - bool almost_equal = (variance1_acc[0] < 2 * variance2_acc[0]) || - (variance2_acc[0] < 2 * variance1_acc[0]); - if (almost_equal) { - if ((std::abs(mean1_acc[0] - mean2_acc[0]) / - std::sqrt((static_cast(1.0) / static_cast(n1) + - static_cast(1.0) / static_cast(n2)) * - ((n1 - 1) * (n1 - 1) * variance1_acc[0] + - (n2 - 1) * (n2 - 1) * variance2_acc[0]) / - (n1 + n2 - 2))) < static_cast(threshold)) { - res = 1; - } else { - res = 0; - } - } else { - if ((std::abs(mean1_acc[0] - mean2_acc[0]) / - std::sqrt((variance1_acc[0] + variance2_acc[0]))) < - static_cast(threshold)) { - res = 1; - } else { - res = 0; - } - } - return res; -} - -int main(int argc, char **argv) { - std::cout << "\nStudent's T-test Simulation" << std::endl; - std::cout << "Buffer Api" << std::endl; - std::cout << "-------------------------------------" << std::endl; - - using fp_type = float; - size_t n_points = n_samples; - fp_type mean = expected_mean; - fp_type std_dev = expected_std_dev; - - if (argc >= 2) { - n_points = std::atol(argv[1]); - if (n_points == 0) { - n_points = n_samples; - } - } - - if (argc >= 3) { - mean = std::atof(argv[2]); - if (std::isnan(mean) || std::isinf(mean)) { - mean = expected_mean; - } - } - - if (argc >= 4) { - std_dev = std::atof(argv[3]); - if (std_dev <= static_cast(0.0f)) { - std_dev = expected_std_dev; - } - } - - std::cout << "Number of random samples = " << n_points - << " with mean = " << mean << ", std_dev = " << std_dev << std::endl; - - // This exception handler with catch async exceptions - auto exception_handler = [](sycl::exception_list exceptions) { - for (std::exception_ptr const &e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const &e) { - std::cout << "Caught asynchronous SYCL exception during generation:\n" - << e.what() << std::endl; - } - } - }; - - std::int32_t res0, res1; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Prepare buffers for random output - sycl::buffer rng_buf0(n_points); - sycl::buffer rng_buf1(n_points); - // Create engine object - oneapi::mkl::rng::default_engine engine(q, seed); - // Create distribution object - oneapi::mkl::rng::gaussian distribution(mean, std_dev); - // Perform generation - oneapi::mkl::rng::generate(distribution, engine, n_points, rng_buf0); - oneapi::mkl::rng::generate(distribution, engine, n_points, rng_buf1); - q.wait_and_throw(); - // Launch T-test with expected mean - res0 = t_test(q, rng_buf0, n_points, mean); - // Launch T-test with two input arrays - res1 = t_test(q, rng_buf0, n_points, rng_buf1, n_points); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Printing results - std::cout << "T-test result with expected mean: " << res0 << std::endl; - std::cout << "T-test result with two input arrays: " << res1 << std::endl << std::endl; - - if(res0 != 1 || res1 != 1) { - std::cout << "TEST FAILED" << std::endl; - return 1; - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} \ No newline at end of file diff --git a/Libraries/oneMKL/student_t_test/t_test_usm.cpp b/Libraries/oneMKL/student_t_test/t_test_usm.cpp deleted file mode 100644 index 27a0869c2b..0000000000 --- a/Libraries/oneMKL/student_t_test/t_test_usm.cpp +++ /dev/null @@ -1,210 +0,0 @@ -//============================================================== -// Copyright © 2021 Intel Corporation -// -// SPDX-License-Identifier: MIT -// ============================================================= - -/* - * - * Content: - * This file contains Student's T-test DPC++ implementation with - * USM APIs. - * - *******************************************************************************/ - -#include -#include -#include -#include - -#include "oneapi/mkl.hpp" - -// Initialization value for random number generator -static const int seed = 7777; -// Quantity of samples to check using Students' T-test -static const int n_samples = 1000000; -// Expected mean value of random samples -static const float expected_mean = 0.0f; -// Expected standard deviation of random samples -static const float expected_std_dev = 1.0f; -// T-test threshold which corresponds to 5% significance level and infinite -// degrees of freedom -static const float threshold = 1.95996f; - -// T-test function with expected mean -// Returns: -1 if something went wrong, 1 - in case of NULL hypothesis should be -// accepted, 0 - in case of NULL hypothesis should be rejected -template -std::int32_t t_test(sycl::queue& q, RealType* r, std::int64_t n, - RealType expected_mean) { - std::int32_t res = -1; - RealType sqrt_n_observations = std::sqrt(static_cast(n)); - - // Allocate memory to be passed inside oneMKL stats functions - RealType* mean = sycl::malloc_shared(1, q); - RealType* variance = sycl::malloc_shared(1, q); - // Perform computations of mean and variance - auto dataset = - oneapi::mkl::stats::make_dataset( - 1, n, r); - oneapi::mkl::stats::mean(q, dataset, mean); - q.wait_and_throw(); - oneapi::mkl::stats::central_moment(q, mean, dataset, variance); - q.wait_and_throw(); - // Check the condition - if ((std::abs(mean[0] - expected_mean) * sqrt_n_observations / - std::sqrt(variance[0])) < static_cast(threshold)) { - res = 1; - } else { - res = 0; - } - // Free allocated memory - sycl::free(mean, q); - sycl::free(variance, q); - return res; -} - -// T-test function with two input arrays -// Returns: -1 if something went wrong, 1 - in case of NULL hypothesis should be -// accepted, 0 - in case of NULL hypothesis should be rejected -template -std::int32_t t_test(sycl::queue& q, RealType* r1, std::int64_t n1, - RealType* r2, std::int64_t n2) { - std::int32_t res = -1; - // Allocate memory to be passed inside oneMKL stats functions - RealType* mean1 = sycl::malloc_shared(1, q); - RealType* variance1 = sycl::malloc_shared(1, q); - RealType* mean2 = sycl::malloc_shared(1, q); - RealType* variance2 = sycl::malloc_shared(1, q); - // Perform computations of mean and variance - auto dataset1 = - oneapi::mkl::stats::make_dataset( - 1, n1, r1); - auto dataset2 = - oneapi::mkl::stats::make_dataset( - 1, n2, r2); - oneapi::mkl::stats::mean(q, dataset1, mean1); - q.wait_and_throw(); - oneapi::mkl::stats::central_moment(q, mean1, dataset1, variance1); - oneapi::mkl::stats::mean(q, dataset2, mean2); - q.wait_and_throw(); - oneapi::mkl::stats::central_moment(q, mean2, dataset2, variance2); - q.wait_and_throw(); - // Check the condition - bool almost_equal = - (variance1[0] < 2 * variance2[0]) || (variance2[0] < 2 * variance1[0]); - if (almost_equal) { - if ((std::abs(mean1[0] - mean2[0]) / - std::sqrt((static_cast(1.0) / static_cast(n1) + - static_cast(1.0) / static_cast(n2)) * - ((n1 - 1) * (n1 - 1) * variance1[0] + - (n2 - 1) * (n2 - 1) * variance2[0]) / - (n1 + n2 - 2))) < static_cast(threshold)) { - res = 1; - } else { - res = 0; - } - } else { - if ((std::abs(mean1[0] - mean2[0]) / - std::sqrt((variance1[0] + variance2[0]))) < - static_cast(threshold)) { - res = 1; - } else { - res = 0; - } - } - // Free allocated memory - sycl::free(mean1, q); - sycl::free(variance1, q); - sycl::free(mean2, q); - sycl::free(variance2, q); - return res; -} - -int main(int argc, char** argv) { - std::cout << "Student's T-test Simulation" << std::endl; - std::cout << "Unified Shared Memory Api" << std::endl; - std::cout << "-------------------------------------" << std::endl; - - using fp_type = float; - size_t n_points = n_samples; - fp_type mean = expected_mean; - fp_type std_dev = expected_std_dev; - - if (argc >= 2) { - n_points = std::atol(argv[1]); - if (n_points == 0) { - n_points = n_samples; - } - } - - if (argc >= 3) { - mean = std::atof(argv[2]); - if (std::isnan(mean) || std::isinf(mean)) { - mean = expected_mean; - } - } - - if (argc >= 4) { - std_dev = std::atof(argv[3]); - if (std_dev <= static_cast(0.0f)) { - std_dev = expected_std_dev; - } - } - - std::cout << "Number of random samples = " << n_points - << " with mean = " << mean << ", std_dev = " << std_dev << std::endl; - - // This exception handler with catch async exceptions - auto exception_handler = [](sycl::exception_list exceptions) { - for (std::exception_ptr const& e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const& e) { - std::cout << "Caught asynchronous SYCL exception during generation:\n" - << e.what() << std::endl; - } - } - }; - - std::int32_t res0, res1; - - try { - // Queue constructor passed exception handler - sycl::queue q(sycl::default_selector_v, exception_handler); - // Allocate memory for random output - fp_type* rng_arr0 = sycl::malloc_shared(n_points, q); - fp_type* rng_arr1 = sycl::malloc_shared(n_points, q); - // Create engine object - oneapi::mkl::rng::default_engine engine(q, seed); - // Create distribution object - oneapi::mkl::rng::gaussian distribution(mean, std_dev); - // Perform generation - oneapi::mkl::rng::generate(distribution, engine, n_points, rng_arr0); - oneapi::mkl::rng::generate(distribution, engine, n_points, rng_arr1); - q.wait_and_throw(); - // Launch T-test with expected mean - res0 = t_test(q, rng_arr0, n_points, mean); - // Launch T-test with two input arrays - res1 = t_test(q, rng_arr0, n_points, rng_arr1, n_points); - // Free allocated memory - sycl::free(rng_arr0, q); - sycl::free(rng_arr1, q); - } catch (...) { - // Some other exception detected - std::cout << "Failure" << std::endl; - std::terminate(); - } - - // Printing results - std::cout << "T-test result with expected mean: " << res0 << std::endl; - std::cout << "T-test result with two input arrays: " << res1 << std::endl << std::endl; - - if(res0 != 1 || res1 != 1) { - std::cout << "TEST FAILED" << std::endl; - return 1; - } - - std::cout << "TEST PASSED" << std::endl; - return 0; -} diff --git a/Libraries/oneMKL/student_t_test/third-party-programs.txt b/Libraries/oneMKL/student_t_test/third-party-programs.txt deleted file mode 100644 index 90daff458d..0000000000 --- a/Libraries/oneMKL/student_t_test/third-party-programs.txt +++ /dev/null @@ -1,253 +0,0 @@ -oneAPI Code Samples - Third Party Programs File - -This file contains the list of third party software ("third party programs") -contained in the Intel software and their required notices and/or license -terms. This third party software, even if included with the distribution of the -Intel software, may be governed by separate license terms, including without -limitation, third party license terms, other Intel software license terms, and -open source software license terms. These separate license terms govern your use -of the third party programs as set forth in the “third-party-programs.txt” or -other similarly named text file. - -Third party programs and their corresponding required notices and/or license -terms are listed below. - --------------------------------------------------------------------------------- - -1. Nothings STB Libraries - -stb/LICENSE - - This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. - Anyone is free to copy, modify, publish, use, compile, sell, or distribute this - software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. - In jurisdictions that recognize copyright laws, the author or authors of this - software dedicate any and all copyright interest in the software to the public - domain. We make this dedication for the benefit of the public at large and to - the detriment of our heirs and successors. We intend this dedication to be an - overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -2. FGPA example designs-gzip - - SDL2.0 - -zlib License - - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - -3. Nbody - (c) 2019 Fabio Baruffa - - Plotly.js - Copyright (c) 2020 Plotly, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -© 2020 GitHub, Inc. - --------------------------------------------------------------------------------- - -4. GNU-EFI - Copyright (c) 1998-2000 Intel Corporation - -The files in the "lib" and "inc" subdirectories are using the EFI Application -Toolkit distributed by Intel at http://developer.intel.com/technology/efi - -This code is covered by the following agreement: - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION -ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT -TO CHANGE WITHOUT NOTICE. - --------------------------------------------------------------------------------- - -5. Edk2 - Copyright (c) 2019, Intel Corporation. All rights reserved. - - Edk2 Basetools - Copyright (c) 2019, Intel Corporation. All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - --------------------------------------------------------------------------------- - -6. Heat Transmission - -GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. -As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. - -“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. - -The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - -a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or -b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - -a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the object code with a copy of the GNU GPL and this license document. -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - -a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. -b) Accompany the Combined Work with a copy of the GNU GPL and this license document. -c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. -d) Do one of the following: -0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. -e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. -b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - --------------------------------------------------------------------------------- -7. Rodinia - Copyright (c)2008-2011 University of Virginia -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -If you use this software or a modified version of it, please cite the most relevant among the following papers: - - - M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International -Symposium on Computer Architecture (ISCA), June 2010. - - - S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron. -Rodinia: A Benchmark Suite for Heterogeneous Computing. IEEE International Symposium -on Workload Characterization, Oct 2009. - -- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization -for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International -Conference on Supercomputing (ICS), June 2009. - -- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems -Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International -Symposium on Computer Architecture (ISCA), June 2009. - -- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA: -A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel -and Distributed Processing Symposium (IPDPS), May 2009. - -- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance -Study of General Purpose Applications on Graphics Processors using CUDA" Journal of -Parallel and Distributed Computing, Elsevier, June 2008. - --------------------------------------------------------------------------------- -Other names and brands may be claimed as the property of others. - --------------------------------------------------------------------------------- \ No newline at end of file From 07e17f836b2935b1c0c4177df4997d05f8240237 Mon Sep 17 00:00:00 2001 From: Tony Feng <103078747+chuanyuf@users.noreply.github.com> Date: Thu, 29 Jan 2026 15:58:58 -0600 Subject: [PATCH 3/4] Merge pull request #2700 from CharlesCongdon/cc_tutupdate20253 2025.3 Guided Debugging Sample updates --- .../CMakeLists.txt | 2 +- .../guided_matrix_mult_BadBuffers/README.md | 291 ++++++++++++------ .../CMakeLists.txt | 2 +- .../guided_matrix_mult_Exceptions/README.md | 72 ++--- .../CMakeLists.txt | 2 +- .../README.md | 169 +++++++--- .../CMakeLists.txt | 2 +- .../README.md | 67 ++-- .../guided_matrix_mult_SLMSize/CMakeLists.txt | 2 +- .../guided_matrix_mult_SLMSize/README.md | 114 ++++--- 10 files changed, 455 insertions(+), 268 deletions(-) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/CMakeLists.txt b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/CMakeLists.txt index 2d72e1d283..ef330e9dbc 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/CMakeLists.txt +++ b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.4) +cmake_minimum_required (VERSION 3.5) set (CMAKE_CXX_COMPILER "icpx") project (matrix_mul LANGUAGES CXX) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md index afab79ab6a..9c8398b822 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md @@ -6,14 +6,14 @@ The sample is a simple program that multiplies together two large matrices and v | Area | Description |:--- |:--- -| What you will learn | A method to determine the root cause problems from passing bad buffers through the SYCL runtime. +| What you will learn | A method to determine the root cause problems from passing bad data through the SYCL runtime. | Time to complete | 50 minutes >**Note**: For comprehensive instructions on the Intel® Distribution for GDB* and writing SYCL code, see the *[Intel® oneAPI Programming Guide](https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/current/overview.html)*. (Use search or the table of contents to find relevant information quickly.) ## Purpose -The two samples in this tutorial show examples of how to debug issues arising from passing bad buffers through the SYCL runtime, one when using SYCL buffers and one when using a direct reference to device memory. +The two samples in this tutorial show examples of how to debug issues arising from passing bad data through the SYCL runtime, one when using SYCL buffers and one when using a direct reference to device memory. In one case, we will know that there is a problem due to a crash. In the other case, we will get bad results. @@ -32,8 +32,8 @@ The sample includes different versions of a simple matrix multiplication program |:--- |:--- | OS | Ubuntu* 24.04 LTS | Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.1
Intel® Distribution for GDB* 2025.1
Unified Tracing and Profiling Tool 2.1.2, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Rolling Release driver 2507.12 or later from https://dgpu-docs.intel.com/releases/releases.html +| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -137,15 +137,73 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -At a step in this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). -To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install ). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). +To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). -### Guided Instructions for Zero Buffer +### Guided Instructions for Zero Buffer using Address Sanitizer +A recent addition to the oneAPI compiler is that ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application. -In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `lambda` function. **This will cause the application to crash.** +1. Compile a version of the program with device-side Address Sanitizer (assuming that you are in the `build` directory) + ``` + icpx -fsycl -O0 -g -Xarch_device -fsanitize=address -std=gnu++17 -Rno-debug-disables-optimization -o a1_matrix_mul_zero_buff_asan ../src/a1_matrix_mul_zero_buff.cpp + ``` + > Note: If you leave the `-Xarch_device` off, this command will look for illegal addresses on the host rather than the device. + +2. Now run the program on the GPU: + ``` + ./a1_matrix_mul_zero_buff_asan + ==== DeviceSanitizer: ASAN + Device: Intel(R) Data Center GPU Max 1550 + Problem size: c(150,600) = a(150,300) * b(300,600) + + ====ERROR: DeviceSanitizer: null-pointer-access on Unknown Memory (0x460) + WRITE of size 4 at kernel (auto&) const::'lambda'(auto)> LID(80, 8, 0) GID(280, 128, 0) + #0 auto auto main::'lambda0'(auto&)::operator()(auto&) const::'lambda'(auto)::operator()>(auto) const Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/build/../src/a1_matrix_mul_zero_buff.cpp:93 + Aborted (core dumped) + ``` + +3. Look at the reported source location + + If you pull up an editor and go to line 93, you will see the following: + ``` + 85 // Submit command group to queue to initialize matrix a + 86 q.submit([&](auto &h) { + 87 // Get write only access to the buffer on a device. + 88 accessor a(a_buf, h, write_only); + 89 + 90 // Execute kernel. + 91 h.parallel_for(range(M, N), [=](auto index) { + 92 // Each element of matrix a is 1. + 93 a[index] = 1.0f; // --- Error here! + 94 }); + 95 }); + ``` + +4. Understand what is happening + + Looking at the error, we see that we were trying to write to local index `LID(80, 8, 0)` , or global index `GID(280, 128, 0)` of array `a`. According to the text when the program ran (`Problem size: c(150,600) = a(150,300) * b(300,600)`) both of these indexes are in range, but are they? + + Take a look at the lines where the arrays are allocated: + + ``` + 61 buffer a_buf(range(0, 0)); + 62 buffer b_buf(range(N, P)); + 63 buffer c_buf(reinterpret_cast(c_back), range(M, P)); + ``` + + Well, that's a problem. `a` was accidentally allocated with zero size. Fix this like you see in `a2_matrix_mul.cpp` and things will work just fine. + + Notice how the Address Sanitizer correctly caught a bad write on the device before it caused problems. + +### Guided Instructions for Zero Buffer using gdb-oneapi and the OpenCL CPU device + +In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `lambda` function. **This will cause the application to crash.** We saw in the previous section how we can catch this with the device-side Address Sanitizer. But what if the bad array allocation occured somewhere else deep in the program? How would we track the problem back to its source? Let's try one technique to locate the source of the error. 1. Run the program without the debugger. + + > ***Warning: this may cause the card to vanish - check with `sycl-ls` after running: if the GPU no longer shows up you will need to reboot the machine before continuing*** + ``` ./a1_matrix_mul_zero_buff ``` @@ -155,13 +213,13 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` Problem size: c(150,600) = a(150,300) * b(300,600) Segmentation fault from GPU at 0x0, ctx_id: 1 (CCS) type: 0 (NotPresent), level: 3 (PML4), access: 1 (Write), banned: 0, aborting. Segmentation fault from GPU at 0x0, ctx_id: 1 (CCS) type: 0 (NotPresent), level: 3 (PML4), access: 1 (Write), banned: 0, aborting. - Abort was called at 274 line in file: + Abort was called at 288 line in file: ./shared/source/os_interface/linux/drm_neo.cpp Aborted (core dumped) ``` - These error messages tells us that we wrote to an address on a memory page that we did not allocate on the GPU (generating an unexpected page fault) + These error messages tell us that we wrote to an address on a memory page (`0x0`) that we did not allocate on the GPU (generating an unexpected page fault). - On an Intel(R) Graphics GPU, the crash will look something like this: + On an Intel(R) Graphics GPU, the crash will look something like this, or the program may hang (exit with `control-C`): ``` Device: Intel(R) Graphics [0xe20b] Problem size: c(150,600) = a(150,300) * b(300,600) @@ -172,32 +230,11 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` 2. Start the debugger to watch the application failure and find out where it failed. Since the message indicates that the failure was on the GPU, we need to enable GPU debugging by doing [some setup on your system](#setting-up-to-debug-on-the-gpu). - However, in this case, let's see if we can catch the stack dump by running on the CPU where it is easier to pull data from the failing kernel. + However, in this case, let's see if we can catch the stack dump by running on the CPU where it is easier to gather data from the failing kernel. ``` ONEAPI_DEVICE_SELECTOR=opencl:cpu gdb-oneapi ./a1_matrix_mul_zero_buff ``` - > **Note:** this will only work if the `sycl-ls` command shows OpenCL - > devices for the graphics card, such as like this: - - ``` - $ sycl-ls - [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] - [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] - [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] - [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - ``` - If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): - - ``` - export DRIVERLOC=/usr/lib/x86_64-linux-gnu - export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC - export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC - ``` 3. You should get the prompt `(gdb)`. @@ -244,9 +281,9 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` at a1_matrix_mul_zero_buff.cpp:123 ``` - Note that the stack originates from `a1_matrix_mul_zero_buff.cpp:123` (if you look in the source you will see that this is the end of the block containing all the offload code), but we crash in `a1_matrix_mul_zero_buff.cpp:93`. This is a side-effect of the fact that SYCL does not wait for the submitted kernel to complete (unless you tell it to), so the main thread has made it all the way past all the offload statements and is waiting for them to complete. + Note that the stack originates from `a1_matrix_mul_zero_buff.cpp:123` (if you look in the source you will see that this is the end of the block containing all the offload code), but we crash in `a1_matrix_mul_zero_buff.cpp:93`. This is a side-effect of the fact that SYCL does not wait for the submitted kernel to complete (unless you tell it to), so the main thread has made it all the way past all the offload statements and is waiting for them to complete when it hears about the segmentation fault. - If the crash happens on a thread other than the first thread, you'll have a shorter that that starts from a "clone": + If the crash happens on a thread other than the first thread, you'll have a shorter stack that starts from a "clone": ``` #0 0x00007ffff7886fa2 in main::{lambda(auto:1&)#2}::operator()(sycl::_V1::handler&) const::{lambda(auto:1)#1}::operator() >(sycl::_V1::item<2, true>) const (this=0x7fffd5fff450, @@ -260,7 +297,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` #21 0x00007ffff72a1e2e in start_thread (arg=) at ./nptl/pthread_create.c:447 #22 0x00007ffff7333a4c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 ``` - This stack might look a little odd due to the fact we are seeing one thread out of many launched to execute the kernels. We ran the debugger on the host OpenCL CPU driver, where the parallel processing is implemented using Intel(R) oneAPI Threading Building Blocks. + This stack might look a little odd due to the fact we are seeing one thread out of many launched to execute the kernels. Because we are running using the host OpenCL CPU driver, parallel processing is implemented using Intel(R) oneAPI Threading Building Blocks which uses `clone` to spawn off additional threads. 6. Examine the code at the crash ``` @@ -289,8 +326,6 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` ``` >**Note:** `/r` disables the *pretty printer* for the SYCL `buffer` class. You can see all available pretty printers using `info pretty-printer` at the `gdb` prompt. - You might notice that this buffer has a size 0 by 0 elements (the `AccessRange` and `MemRange` are for a `common_array` of size 0 by 0 elements). Since it has zero size, this buffer is the problem. - ``` $2 = { >> = { static AS = sycl::_V1::access::address_space::global_space, static IsHostBuf = false, static IsHostTask = false, @@ -305,6 +340,8 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` MemRange = {> = {common_array = {0, 0}}, static dimensions = }}, { MData = 0x0}} ``` + + You might notice that this buffer has a size 0 by 0 elements (the `AccessRange` and `MemRange` are for a `common_array` of size 0 by 0 elements). Since it has zero size, this buffer is the problem. 8. Now look at the `index` variable, which represents the iteration space that we will traverse to set all elements of the array `a` to an initial value of `1.0`. You will see something like this: ``` @@ -316,9 +353,9 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` 0}}, static dimensions = }, MOffset = {> = {common_array = {0, 0}}, static dimensions = }}} ``` - Clearly there is a mismatch here! 'a' has no space reserved for it, yet we will be iterating over 150 by 300 elements (and updating element 120 by 144 in this thread), which is clearly an error. + Clearly there is a mismatch here! 'a' has no space reserved for it, yet we will be iterating over 150 by 300 elements (and updating element 131 by 0 in this thread), which is clearly an error. -9. To further root-cause the error, we will need to restart the program and look at the values of `a_buf` and `b_buf`, which are not in scope in any of our stack frames. We'll set some breakpoints where they are used: +9. To further root-cause the error, we will need to restart the program and look at the values of the buffers behind the accessors (`a_buf` and `b_buf`), which are not in scope in any of our stack frames. We'll set some breakpoints at the `parallel_for` statements where they are initialized. ``` (gdb) b 79 @@ -335,7 +372,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` Problem size: c(150,600) = a(150,300) * b(300,600) Thread 1 "a1_matrix_mul_z" hit Breakpoint 1.1, main::{lambda(auto:1&)#1}::operator()(sycl::_V1::handler&) const (this=0x7fffffffb550, h=sycl::handler& = {...}) - at /nfs/site/home/cwcongdo/oneAPI-samples-mine/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/a1_matrix_mul_zero_buff.cpp:79 + at Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/a1_matrix_mul_zero_buff.cpp:79 79 h.parallel_for(range(N, P), [=](auto index) { (gdb) ``` @@ -355,7 +392,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` Continuing. Thread 1 "a1_matrix_mul_z" hit Breakpoint 2.1, main::{lambda(auto:1&)#2}::operator()(sycl::_V1::handler&) const (this=0x7fffffffb550, h=sycl::handler& = {...}) - at /nfs/site/home/cwcongdo/oneAPI-samples-mine/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/a1_matrix_mul_zero_buff.cpp:91 + at Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/a1_matrix_mul_zero_buff.cpp:91 91 h.parallel_for(range(M, N), [=](auto index) { (gdb) p a $7 = sycl::accessor write range {0, 0, 1} @@ -368,8 +405,8 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` Looking at the source again, you'll see that this originated when the buffers were created around line 61 and 62: ``` - buffer a_buf(range(0, 0)); - buffer b_buf(range(N, P)); + 61 buffer a_buf(range(0, 0)); + 62 buffer b_buf(range(N, P)); ``` In real code the values to the ranges may be passed into the function from outside, so you will need to inspect those as well as the code where they are calculated. For example, you would need to find the values of `M`, `N`, and `P` to make sure that the resulting buffer sizes are non-zero in these buffer definitions: @@ -378,15 +415,85 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` buffer b_buf(range(N, P)); ``` -### Guided Instructions for Null Device Pointer +### Guided Instructions for Null Device Pointer using Address Sanitizer +Let us use the Address Sanitizer again to catch invalid pointer addresses at runtime, this time in code that makes use of explicit device memory allocations rather than using SYCL buffers. This will require a special build of the application. + +1. Compile a version of the program with device-side Address Sanitizer (assuming that you are in the `build` directory) + ``` + icpx -fsycl -O0 -g -Xarch_device -fsanitize=address -std=gnu++17 -Rno-debug-disables-optimization -o b1_matrix_mul_null_usm_asan ../src/b1_matrix_mul_null_usm.cpp + ``` + +2. Now run the program on the GPU: + ``` + ./b1_matrix_mul_null_usm_asan + Initializing + ==== DeviceSanitizer: ASAN + Computing + Device: Intel(R) Data Center GPU Max 1550 + Device compute units: 512 + Device max work item size: 1024, 1024, 1024 + Device max work group size: 1024 + Problem size: c(150,600) = a(150,300) * b(300,600) + + ====ERROR: DeviceSanitizer: null-pointer-access on Unknown Memory (0x15630) + READ of size 4 at kernel (auto&) const::'lambda'(auto)> LID(68, 3, 0) GID(468, 73, 0) + #0 auto auto main::'lambda0'(auto&)::operator()(auto&) const::'lambda'(auto)::operator()>(auto) const Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/build/../src/b1_matrix_mul_null_usm.cpp:122 + Aborted (core dumped) + ``` + +3. Look at the reported source location + + If you pull up an editor and go to line 122, you will see the following: + ``` + // Submit command group to queue to multiply matrices: c = a * b + 107 q.submit([&](auto &h) { + 108 // Read from a and b, write to c + 109 int width_a = N; + 110 + 111 // Execute kernel. + 112 h.parallel_for(range(M, P), [=](auto index) { + 113 // Get global position in Y direction. + 114 int row = index[0]; // m + 115 int col = index[1]; // p + 116 float sum = 0.0f; + 117 + 118 // Compute the result of one element of c + 119 for (int i = 0; i < width_a; i++) { + 120 auto a_index = row * width_a + i; + 121 auto b_index = i * P + col; + 122 sum += dev_a[a_index] * dev_b[b_index]; // ----- Problem here + 123 } + 124 + 125 auto idx = row * P + col; + 126 dev_c[idx] = sum; + 127 }); + 128 }); + ``` + +4. Putting together what we know + + Looking at the error, we see that we were trying to read local index `LID(68, 3, 0)` , or global index `GID(468, 73, 0)` of either array `a` or array `b`. According to the text when the program ran (`Problem size: c(150,600) = a(150,300) * b(300,600)`) both of these indexes are in range, but are they? + + Take a look at the lines where the arrays are allocated: + + ``` + 79 float * dev_a = sycl::malloc_device(M*N, q); + 80 float * dev_b = sycl::malloc_device(N*P, q); + 81 float * dev_c = sycl::malloc_device(M*P, q); + ``` + + Those look OK, but the Address Sanitizer is telling us that someplace after that allocation something went wrong. Unless you are lucky and spot the problem by manual analysis (tricky in a large code base), it's time to pull out the debugger and see what is going on with the pointers `dev_a` and `dev_b`. -In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is supposed to represent unallocated memory on the device is inadvertently used in a kernel. This example uses unified shared memory rather than SYCL buffers like the previous example. +### Guided Instructions for Null Device Pointer using gdb-oneapi and the OpenCL CPU device +In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is supposed to represent allocated memory on the device is inadvertently passed as an argument to a kernel. This example uses explicitly allocated device memory rather than SYCL buffers like the previous example. + +#### Checking the Behavior using Multiple Backends 1. Run the program on the GPU using Level Zero. ``` ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./b1_matrix_mul_null_usm ``` - This run produces troublesome output. + This run produces troublesome output - a crash due to accessing an illegal (non-allocated) memory. ``` Device max work group size: 1024 Problem size: c(150,600) = a(150,300) * b(300,600) @@ -405,40 +512,39 @@ In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is suppo The results should be the same as the Level Zero output. > **Note:** this will only work if the `sycl-ls` command shows OpenCL - > devices for the graphics card, such as like this: + devices for the graphics card, such as like this: ``` - $ sycl-ls - [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] - [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] - [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] - [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] + $ sycl-ls + [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] + [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] + [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] + [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] + [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] + [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] + [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] ``` - If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): + > If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): ``` - export DRIVERLOC=/usr/lib/x86_64-linux-gnu - export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC - export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC + export DRIVERLOC=/usr/lib/x86_64-linux-gnu + export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC + export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC ``` 3. Check the output we get by bypassing the GPU entirely and using the OpenCL driver for CPU. ``` ONEAPI_DEVICE_SELECTOR=opencl:cpu ./b1_matrix_mul_null_usm - ``` - ``` + : Problem size: c(150,600) = a(150,300) * b(300,600) Segmentation fault (core dumped) ``` -#### Attempting to Understand What Is Happening +#### Debugging the Problem -Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests as something that goes terribly wrong. Or one of the backbends might have a bug. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address 0x0, while this may be legally allocated memory on the GPU. +Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests as something that goes terribly wrong. Or one of the backbends might have a bug while the others do not. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address `0x0`, while this may be legally allocated memory on the GPU. Another reason to try different backends is that debugging support may differ between different GPU drivers and/or different GPU models. Debugging the program using the OpenCL™ CPU driver gets around these issues. @@ -472,7 +578,7 @@ Let's see what caused the problem by running in the debugger: ``` (gdb) backtrace ``` - You should see output similar to the following. + You should see output similar to the following, showing the stack for one oneTBB thread: ``` #0 0x00007ffff4a75f60 in main::{lambda(auto:1&)#2}::operator()(sycl::_V1::handler&) const::{lambda(auto:1)#1}::operator() >(sycl::_V1::item<2, true>) const (this=0x7fff3d5ff438, index=sycl::item range ..., offset ... = ...) at b1_matrix_mul_null_usm.cpp:122 @@ -486,6 +592,8 @@ Let's see what caused the problem by running in the debugger: (gdb) ``` + Or you will see a longer stack dump for the main thread, which also shows a problem at `b1_matrix_mul_null_usm.cpp:122` + 5. We got lucky in that the frame where we crashed is in our code. Let's examine the code in a little more detail: ``` (gdb) list @@ -498,12 +606,11 @@ Let's see what caused the problem by running in the debugger: 119 for (int i = 0; i < width_a; i++) { 120 auto a_index = row * width_a + i; 121 auto b_index = i * P + col; - 122 sum += dev_a[a_index] * dev_b[b_index]; + 122 sum += dev_a[a_index] * dev_b[b_index]; // --- Problems here 123 } 124 125 auto idx = row * P + col; 126 dev_c[idx] = sum; - ``` 6. Let's check the pointers in use at line 122. @@ -525,17 +632,19 @@ Let's see what caused the problem by running in the debugger: ``` This located the problem: one of the array pointers is null (zero) while the other has a (hopefully) valid value. If both pointers were valid, we'd want to check the index values being used to access the arrays, and the memory values at those locations (and at the start of the array). + At this point you know what the problem is. Now you need to track down the source of the bad address - somewhere between the allocation of the buffer, and the use of the pointer to the buffer. + #### Understanding What Is Happening -Early on, operating system designers realized that it was common for developers to write bugs in which they accidentally try to de-reference null pointers (access them like an array). To make it easier to find these errors the operating system designers implemented logic that made it illegal for any program to access the first two memory pages (so from address 0x0 to around 0x2000). They didn't go further to explicitly validate the address of any memory accessed by a program (because it is too expensive), but this range of illegal addresses was a cheap check that caught a huge number of bugs. +Early on, operating system designers realized that it was common for developers to write bugs in which they accidentally try to de-reference null pointers. To make it easier to find these errors the operating system designers implemented logic that made it illegal for any program to access the first two memory pages (so from address `0x0` to around `0x2000`). -GPUs typically don't have a lot of memory, so they can't afford to set aside a large range of illegal addresses. So both Level Zero and OpenCL passed on the pointer to device memory (in our case intentionally zero) assuming it was valid. From there we had three possible outcomes: +GPUs typically don't have a lot of memory, so they can't afford to set aside a range of illegal addresses. So both Level Zero and OpenCL passed on the pointer to device memory (in our case intentionally zero) assuming it was valid. From there we had three possible outcomes: 1. If the pointer was correct and pointing to allocated memory, the program would have completed correctly. 2. If the pointer was incorrect but was pointing to memory allocated for something else, the kernel would have accessed random memory values in calculating the sum on line 122, and returned incorrect results as a consequence. 3. If the pointer was incorrect and pointing to memory that was never allocated, the kernel will crash on either the GPU or CPU. -What would we have seen if `dev_a` had contained just a random pointer value? If you were lucky, the address returned when you print `dev_a` would look non-null and very different from the one returned when you printed `dev_b`, but that's not a certainty. Or it would have pointed to memory not owned by your process and caused a crash. +What would we have seen if `dev_a` had contained just a random pointer value? If you were lucky, the address returned when you print `dev_a` would look non-null and very different from the one returned when you printed `dev_b`, but that's not a certainty. Or it would have pointed to memory not owned by your process and caused a crash. Either way, your program would not produced correct results, if it ran at all. #### Other Debug Techniques @@ -552,29 +661,29 @@ You need to build `unitrace` before you can use it. See the instructions at [Uni While reviewing the output, you might see something like the following excerpt near the bottom of the output. ``` : - >>>> [1487508411066857] zeKernelCreate: hModule = 44797904 desc = 140735939087520 {ZE_STRUCTURE_TYPE_KERNEL_DESC(0x1d) 0 0 "_ZTSZZ4mainENKUlRT_E0_clIN4sycl3_V17handlerEEEDaS0_EUlS_E_"} phKernel = 140735939087512 (hKernel = 14798282318754847232) - <<<< [1487508411092885] zeKernelCreate [21566 ns] hKernel = 44799912 -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411096140] zeDeviceGetSubDevices: hDevice = 39507224 pCount = 140735939087500 (Count = 0) phSubdevices = 0 - <<<< [1487508411098094] zeDeviceGetSubDevices [395 ns] Count = 0 -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411099724] zeDeviceGetSubDevices: hDevice = 39507224 pCount = 140735939087500 (Count = 0) phSubdevices = 0 - <<<< [1487508411100759] zeDeviceGetSubDevices [22 ns] Count = 0 -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411104804] zeKernelSetIndirectAccess: hKernel = 44799912 flags = 7 - <<<< [1487508411106715] zeKernelSetIndirectAccess [431 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411113472] zeKernelGetProperties: hKernel = 44799912 pKernelProperties = 45076936 - <<<< [1487508411122357] zeKernelGetProperties [7693 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411125804] zeKernelSetArgumentValue: hKernel = 44799912 argIndex = 0 argSize = 4 pArgValue = 44677968 - <<<< [1487508411127704] zeKernelSetArgumentValue [265 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411130788] zeKernelSetArgumentValue: hKernel = 44799912 argIndex = 1 argSize = 8 pArgValue = 0 - <<<< [1487508411132260] zeKernelSetArgumentValue [528 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411133457] zeKernelSetArgumentValue: hKernel = 44799912 argIndex = 2 argSize = 8 pArgValue = 140735939087912 - <<<< [1487508411135573] zeKernelSetArgumentValue [1131 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [1487508411136604] zeKernelSetArgumentValue: hKernel = 44799912 argIndex = 3 argSize = 8 pArgValue = 140735939087912 - <<<< [1487508411137932] zeKernelSetArgumentValue [459 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101562718] zeKernelCreate: hModule = 0x3621f28 desc = 0x7ffed5a4cc80 {ZE_STRUCTURE_TYPE_KERNEL_DESC(0x1d) 0 0 "_ZTSZZ4mainENKUlRT_E0_clIN4sycl3_V17handlerEEEDaS0_EUlS_E_"} phKernel = 0x7ffed5a4cc78 (hKernel = 0x35a1110) + <<<< [500091101674826] zeKernelCreate [96812 ns] hKernel = 0x337e668 -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101689327] zeDeviceGetSubDevices: hDevice = 0x325eee8 pCount = 0x7ffed5a4cc74 (Count = 0x0) phSubdevices = 0x0 + <<<< [500091101697229] zeDeviceGetSubDevices [630 ns] Count = 0x0 -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101705199] zeDeviceGetSubDevices: hDevice = 0x325eee8 pCount = 0x7ffed5a4cc74 (Count = 0x0) phSubdevices = 0x0 + <<<< [500091101711447] zeDeviceGetSubDevices [208 ns] Count = 0x0 -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101738711] zeKernelSetIndirectAccess: hKernel = 0x337e668 flags = 0x7 + <<<< [500091101745875] zeKernelSetIndirectAccess [724 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101763140] zeKernelGetProperties: hKernel = 0x337e668 pKernelProperties = 0x36333c8 + <<<< [500091101771939] zeKernelGetProperties [1608 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101796337] zeKernelSetArgumentValue: hKernel = 0x337e668 argIndex = 0x0 argSize = 0x4 pArgValue = 0x36046a8 ArgValue = 0x12c + <<<< [500091101806110] zeKernelSetArgumentValue [1133 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101814314] zeKernelSetArgumentValue: hKernel = 0x337e668 argIndex = 0x1 argSize = 0x8 pArgValue = 0x0 (NULL) + <<<< [500091101820959] zeKernelSetArgumentValue [770 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101827079] zeKernelSetArgumentValue: hKernel = 0x337e668 argIndex = 0x2 argSize = 0x8 pArgValue = 0x7ffed5a4ce00 ArgValue = 0xff00fffffff00000 + <<<< [500091101836736] zeKernelSetArgumentValue [2819 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [500091101842752] zeKernelSetArgumentValue: hKernel = 0x337e668 argIndex = 0x3 argSize = 0x8 pArgValue = 0x7ffed5a4ce00 ArgValue = 0xff00ffffffea0000 + <<<< [500091101849732] zeKernelSetArgumentValue [1181 ns] -> ZE_RESULT_SUCCESS(0x0) : ``` - Notice how all the kernel arguments have a non-zero value except one (`argIndex = 1`) when they are set up. We have nothing to help us map the kernel arguments created by the SYCL runtime and passed to Level Zero to the arguments in the user program (the value may be OK). However, if you see a kernel argument that looks out of place (note that the values at all other argument indexes are very similar), you might want to be suspicious. + Notice how all the kernel arguments have a non-zero value except one (`argIndex = 0x1`) when they are set up. We have nothing to help us map the kernel arguments created by the SYCL runtime and passed to Level Zero to the arguments in the user program (the value may be OK). However, if you see a kernel argument that looks out of place (note that the values at all other argument indexes are very similar), you might want to be suspicious. - Other than this clue, there are no other hints that the bad output from the program is due to a bad input argument rather than a race condition or other algorithmic error. These sorts of issues can be partically tricky to diagnose when the device pointers are initialized in a different part of the program, or in a 3rd-party library. + Other than this clue, there are no other hints that the bad output from the program is due to a bad input argument rather than a race condition or other algorithmic error. These sorts of issues can be particularly tricky to diagnose when the device pointers are initialized in a different part of the program, or in a 3rd-party library. ## License diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/CMakeLists.txt b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/CMakeLists.txt index 510d479316..87dd6fdf07 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/CMakeLists.txt +++ b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.4) +cmake_minimum_required (VERSION 3.5) set (CMAKE_CXX_COMPILER "icpx") project (matrix_mul LANGUAGES CXX) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md index d7308606c2..dd8b72569f 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md @@ -13,7 +13,7 @@ The sample code is a simple program that multiplies together two large matrices ## Purpose -The two samples in this tutorial show examples of situations where the SYCL runtime provides an assert when it detects incorrect use of the SYCL API that is not caught at build time. Unfortunately, these runtime error checks are not comprehensive, so not getting an assert does not indicate correct code structure or practices. +The two samples in this tutorial show situations where the SYCL runtime provides an assert when it detects incorrect use of the SYCL API that is not caught at build time. Unfortunately, these runtime error checks are not comprehensive, so not getting an assert does not indicate correct code structure or practices. Currently, SYCL asserts only tell you that an error was detected, but not where it resides in your code. To determine the location, you must run the program in the Intel® Distribution for GDB* with debug symbols enabled. Turning off optimization can also help. @@ -31,11 +31,12 @@ The sample includes three different versions of some simple matrix multiplicatio ## Prerequisites -| Optimized for | Description -|:--- |:--- +| Optimized for | Description +|:--- |:--- | OS | Ubuntu* 24.04 LTS | Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.1
Intel® Distribution for GDB* 2025.1 +| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3 +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -54,7 +55,7 @@ When working with the command-line interface (CLI), you should configure the one ## Build and Run the `Guided Matrix Multiplication Exception` Programs > **Note**: If you have not already done so, set up your CLI -> environment by sourcing the `setvars` script in the root of your oneAPI installation. +environment by sourcing the `setvars` script in the root of your oneAPI installation. > > Linux*: > - For system wide installations: `. /opt/intel/oneapi/setvars.sh` @@ -147,7 +148,7 @@ In `1_matrix_mul_null_pointer` a null pointer is passed to a SYCL `memcpy` state Device max work item size: 1024, 1024, 1024 Device max work group size: 1024 Problem size: c(150,600) = a(150,300) * b(300,600) - Exception caught at File: 1_matrix_mul_null_pointer.cpp | Function: main | Line: 95 | Column: 5 + Exception caught at File: 1_matrix_mul_null_pointer.cpp | Function: main | Line: 95 | Column: 7 terminate called after throwing an instance of 'sycl::_V1::exception' what(): NULL pointer argument in memory copy operation. Aborted (core dumped) @@ -160,13 +161,15 @@ As an exercise, let's find this a debugger (any host debugger will work; however gdb-oneapi ./1_matrix_mul_null_pointer (gdb) run ``` - When you get the error message `Debugging of GPU offloaded code is not enabled`, ignore it and answer `n` to the question `Quit anyway? (y or n)` + > When you get the error message `Debugging of GPU offloaded code is not enabled`, ignore it and answer `n` to the question `Quit anyway? (y or n)`. You may need to do this more than once. + + > Why can we ignore these messages and keep on debugging anyway? Because we don't need to monitor the code running on the device in the debugger - the asserts are coming from the host during the call of the kernel. Running `gdb-oneapi` with `ZET_ENABLE_PROGRAM_DEBUGGING=1` is only necessary if you want to debug the kernels running on the GPU. 2. Notice the application failure. The error is the same message seen when we ran it outside the debugger. ``` - Exception caught at File: 1_matrix_mul_null_pointer.cpp | Function: main | Line: 95 | Column: 5 + Exception caught at File: 1_matrix_mul_null_pointer.cpp | Function: main | Line: 95 | Column: 7 terminate called after throwing an instance of 'sycl::_V1::exception' - what(): NULL pointer argument in memory copy operation. + what(): NULL pointer argument in memory copy operation. Thread 1.1 "1_matrix_mul_nu" received signal SIGABRT, Aborted. ``` @@ -215,7 +218,9 @@ In the second version, the code attempts to execute more than one offload statem gdb-oneapi ./2_matrix_mul_multi_offload (gdb) run ``` - When you get the error message `Debugging of GPU offloaded code is not enabled`, ignore it and answer `n` to the question `Quit anyway? (y or n)` + > When you get the error message `Debugging of GPU offloaded code is not enabled`, ignore it and answer `n` to the question `Quit anyway? (y or n)`. You may need to do this more than once. + + > Why can we ignore these messages and keep on debugging anyway? Because we don't need to monitor the code running on the device in the debugger - the asserts are coming from the host during the call of the kernel. Running `gdb-oneapi` with `ZET_ENABLE_PROGRAM_DEBUGGING=1` is only necessary if you want to debug the kernels running on the GPU. 2. The error is the same message seen when we ran it outside the debugger. ``` @@ -224,14 +229,14 @@ In the second version, the code attempts to execute more than one offload statem Thread 1.1 "2_matrix_mul_mu" received signal SIGABRT, Aborted. ``` - The exception talks about a “command group” and that only a single command group is allowed within a `submit`. A command group is something like a `parallel_for` or a SYCL `memcpy` statement – it’s a language construct or function call that makes something happen on the device. Only one action is allowed per `submit` construct. + The exception talks about a “command group” and that only a single command group is allowed within a `submit`. A command group is something like a `parallel_for` or a SYCL `memcpy` statement – it’s a language construct or function call that makes something happen on the device. Only one such action is allowed per `submit` construct. 3. Run a `backtrace` to get summary showing the rough location that triggered the assert. ``` (gdb) backtrace ``` -4. Notice in the results (which should look something like the following) that the exception (frame 8) was triggered around line 98 (frame 19): +4. Notice in the results (which should look something like the following) that the exception (frame 8) was triggered around line 98 (frame 17): ``` #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=) at ./nptl/pthread_kill.c:78 @@ -242,37 +247,34 @@ In the second version, the code attempts to execute more than one offload statem #6 0x00007ffff78bb0da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff78a5a55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x00007ffff78bb391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 - #9 0x00007ffff7f076a0 in sycl::_V1::handler::memcpy(void*, void const*, unsigned long) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #10 0x0000000000404ba2 in main::{lambda(auto:1&)#1}::operator()(sycl::_V1::handler&) const ( - this=0x7fffffffb2d8, h=sycl::handler& = {...}) - at /nfs/site/home/cwcongdo/oneAPI-samples-true/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp:100 - #11 0x0000000000404b3d in std::__invoke_impl(std::__invoke_other, main::{lambda(auto:1&)#1}&, sycl::_V1::handler&) (__f=..., __args=sycl::handler& = {...}) - at /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61 - #12 0x0000000000404add in std::__invoke_r(main::{lambda(auto:1&)#1}&, sycl::_V1::handler&) (__fn=..., __args=sycl::handler& = {...}) - at /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:111 - #13 0x00000000004049f5 in std::_Function_handler::_M_invoke(std::_Any_data const&, sycl::_V1::handler&) (__functor=..., __args=sycl::handler& = {...}) - at /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290 - #14 0x00007ffff7e83121 in sycl::_V1::detail::queue_impl::submit_impl(std::function const&, std::shared_ptr const&, std::shared_ptr const&, std::shared_ptr const&, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::SubmissionInfo const&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #15 0x00007ffff7e895c8 in sycl::_V1::detail::queue_impl::submit_with_event(std::function const&, std::shared_ptr const&, sycl::_V1::detail::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #16 0x00007ffff7f33afa in sycl::_V1::queue::submit_with_event_impl(std::function, sycl::_V1::detail::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #17 0x00000000004048b3 in sycl::_V1::queue::submit_with_event(main::{lambda(auto:1&)#1}, sycl::_V1::queue*, sycl::_V1::detail::code_location const&) (this=0x7fffffffb860, CGF=..., SecondaryQueuePtr=0x0, - CodeLoc=...) at /opt/intel/oneapi/compiler/2025.1/bin/compiler/../../include/sycl/queue.hpp:2826 - #18 0x00000000004042cd in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb860, CGF=..., CodeLoc=...) - at /opt/intel/oneapi/compiler/2025.1/bin/compiler/../../include/sycl/queue.hpp:365 - #19 0x0000000000403edc in main () - at 2_matrix_mul_multi_offload.cpp:98 + #9 0x00007ffff7f11ed0 in sycl::_V1::handler::memcpy(void*, void const*, unsigned long) () + from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 + #10 0x0000000000404812 in main::{lambda(auto:1&)#1}::operator()(sycl::_V1::handler&) const ( + this=0x7fffffffb098, h=sycl::handler& = {...}) + at Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp:100 + #11 0x00000000004047ad in sycl::_V1::detail::type_erased_cgfo_ty::invoker::call(void const*, sycl::_V1::handler&) (object=0x7fffffffb098, cgh=sycl::handler& = {...}) + at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/handler.hpp:190 + #12 0x00007ffff7e8a4a4 in sycl::_V1::detail::queue_impl::submit_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::queue_impl*, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::v1::SubmissionInfo const&) () from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 + #13 0x00007ffff7e90022 in sycl::_V1::detail::queue_impl::submit_with_event(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::v1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () + from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 + #14 0x00007ffff7f58844 in sycl::_V1::queue::submit_with_event_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::v1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) const () + from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 + #15 0x0000000000407392 in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb570, Props=..., CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:3762 + #16 0x00000000004042a1 in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb570, CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:429 + #17 0x0000000000403eac in main () + at Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp:98 ``` 5. Examine the last frame (it may be different from the output above) using the following command: ``` - (gdb) frame 19 + (gdb) frame 17 ``` You may need to issue this command twice before you see output similar to the following example: ``` - #19 0x0000000000403e7c in main () + #17 0x0000000000403e7c in main () at 2_matrix_mul_multi_offload.cpp:98 98 q.submit([&](auto &h) { ``` diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/CMakeLists.txt b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/CMakeLists.txt index 1d4ec9e7d4..cbdfc82bda 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/CMakeLists.txt +++ b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.4) +cmake_minimum_required (VERSION 3.5) set (CMAKE_CXX_COMPILER "icpx") project (matrix_mul LANGUAGES CXX) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md index 7977f5e293..7bca9f4b79 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md @@ -19,7 +19,7 @@ verifies the results. The sample in this tutorial shows how to debug incorrect use of variables that are owned by different queues that have different contexts. -This type of error can be hard to detect and determine the root cause in a +This type of error can be hard to detect and root cause in a large body of code where queues and memory are passed between functions. The lack of tools that tell you what is wrong combined with the fact that the default Level Zero driver does not notice there is a problem (only the OpenCL™ @@ -37,12 +37,12 @@ program. ## Prerequisites -| Optimized for | Description -|:--- |:--- +| Optimized for | Description +|:--- |:--- | OS | Ubuntu* 24.04 LTS | Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.1
Intel® Distribution for GDB* 2025.1
Unified Tracing and Profiling Tool 2.1.2, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Rolling Release driver 2507.12 or later from https://dgpu-docs.intel.com/releases/releases.html +| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -163,20 +163,16 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -At a step in this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). -To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install ). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). +To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). ### Check the Programs 1. Notice that both versions of the application run to completion and report correct results. - SYCL applications use the Level Zero runtime by default with an Intel GPU. - If you use OpenCL™ software to run `1_matrix_mul_invalid_contexts`, the - program with a bug in it will crash before it can report results. - -2. Check the results on a **GPU** with OpenCL. +2. SYCL applications use the Level Zero runtime by default with an Intel GPU. What happens if you use OpenCL™ software to run `1_matrix_mul_invalid_contexts` on the GPU? ``` ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_invalid_contexts @@ -193,39 +189,126 @@ To complete the steps in the following section, you must download the [Unified T Device max work group size: 1024 Problem size: c(150,600) = a(150,300) * b(300,600) terminate called after throwing an instance of 'sycl::_V1::exception' - what(): Enqueue process failed. + what(): Enqueue process failed. + opencl backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Aborted (core dumped) ``` > **Note:** this will only work if the `sycl-ls` command shows OpenCL - > devices for the graphics card, such as like this: + devices for the graphics card, such as like this: ``` - $ sycl-ls - [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] - [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] - [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] - [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] + $ sycl-ls + [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] + [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] + [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] + [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] + [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] + [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] + [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] ``` - If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): + > If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): ``` - export DRIVERLOC=/usr/lib/x86_64-linux-gnu - export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC - export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC + export DRIVERLOC=/usr/lib/x86_64-linux-gnu + export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC + export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC ``` + 3. Check the results on the **CPU** using OpenCL. ``` ONEAPI_DEVICE_SELECTOR=opencl:cpu ./1_matrix_mul_invalid_contexts ``` - Interestingly, this runs just fine. In the next section we will try to explain the inconsistency. + Interestingly, this runs just fine. In the next sections we will try to explain the inconsistency. + +### Guided Instructions for Zero Buffer using Address Sanitizer +A recent addition to the oneAPI compiler is that ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application. + +1. Compile a version of the program with device-side address sanitizer (assuming that you are in the `build` directory) + ``` + icpx -fsycl -O0 -g -Xarch_device -fsanitize=address -std=gnu++17 -Rno-debug-disables-optimization -o 1_matrix_mul_invalid_contexts_asan ../src/1_matrix_mul_invalid_contexts.cpp + ``` + > Note: If you leave the `-Xarch_device` off, this command will look for illegal addresses on the host rather than the device. + +2. Now run the program on the GPU: + ``` + ./1_matrix_mul_invalid_contexts_asan + Initializing + ==== DeviceSanitizer: ASAN + Computing + Device: Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz + Device compute units: 144 + Device max work item size: 8192, 8192, 8192 + Device max work group size: 8192 + Problem size: c(150,600) = a(150,300) * b(300,600) + + ====ERROR: DeviceSanitizer: invalid-argument on kernel (auto&) const::'lambda'(auto)> + #0 in sycl::_V1::event sycl::_V1::queue::submit_with_event>>(sycl::_V1::ext::oneapi::experimental::properties>, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:3762:12 + #1 in std::enable_if, sycl::_V1::event>::type sycl::_V1::queue::submit(auto, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:429:12 + #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:106:7 + #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5bd8f) + #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5be3f) + #5 in _start (./1_matrix_mul_invalid_contexts_asan+0x403624) + + The 5th argument 0x7fddcf88a800 is allocated in other context + 0x7fddcf88a800 is located inside of Device USM region [0x7fddcf88a800, 0x7fddcf8e2640) + allocated here: + #0 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::device const&, sycl::_V1::context const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/usm.hpp:174:27 + #1 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::queue const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/usm.hpp:182:10 + #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:82:21 + #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5bd8f) + #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5be3f) + #5 in _start (./1_matrix_mul_invalid_contexts_asan+0x403624) + + Aborted (core dumped) + ``` + + Remember that SYCL applications use the Level Zero runtime by default with an Intel GPU, and that when we ran this version of the program without Address Sanitizer everything looked fine. So, is this a problem with Address Sanitizer or the program? + +3. Look at the reported source location + + That Address Sanitizer threw an error at line 106 where we enter the main work kernel. + + ``` + 99 q.submit([&](auto &h) { + 100 h.memcpy(dev_c, &c_back[0], M*P * sizeof(float)); + 101 }); + 102 + 103 q.wait(); + 104 + 105 // Submit command group to queue to multiply matrices: c = a * b + 106 q.submit([&](auto &h) { // Something reported wrong here + 107 // Read from a and b, write to c + 108 int width_a = N; + 109 + 110 // Execute kernel. + ``` + + And it complained that "the 5th argument" was allocated in another context, an element that was set up in line 82: + + ``` + 77 float * dev_a = sycl::malloc_device(M*N, q); + 78 float * dev_b = sycl::malloc_device(N*P, q); + 79 device selected_device = device(default_selector_v); + 80 context devicecontext(selected_device); + 81 queue q2(devicecontext, selected_device); + 82 float * dev_c = sycl::malloc_device(M*P, q2); // Complaining about this + 83 + 84 cout << "Problem size: c(" << M << "," << P << ") = a(" << M << "," << N + 85 << ") * b(" << N << "," << P << ")\n"; + ``` + + Unfortunately, figuring out which "5th argument" of which kernel is involved requires internal knowledge of Level Zero API calls and how SYCL collects the references used in the `q.submit` lambda function at line 106. We can get some of this by running `unitrace ` against `./1_matrix_mul_invalid_contexts_asan`, but the result is not satisfying. + + Also, it may not be useful to figure out which argument was involved, because this may not be where things first go bad. The SYCL syntax used in this program means that `q.submit` statements will immediately return control to the calling program even if the submitted kernel is still running. So the problem might have occurred before line 106, and we are only just now learning about it. + + However, we don't need to go that deep into the internals. We are told that the invalid element encountered at line 106 was allocated to a different context in line 82. Here we see that `dev_c` is the variable, and it was allocated a size of `M*P` using queue `q2`. + + You've probably spotted the problem in this trivial example, but let's use the debugger to see if we can gather additional information to do a proper diagnosis. ### Use the Debugger to Find the Issue @@ -276,7 +359,7 @@ In case we need view code running on the GPU, we need to enable GPU debugging. 4. Prompt for a call stack to inspect the results. ``` - (gdb) where + (gdb) backtrace ``` The output can be extensive and might look similar to the following: @@ -324,7 +407,7 @@ In case we need view code running on the GPU, we need to enable GPU debugging. ``` #18 0x0000000000403f7b in main () - at /nfs/site/home/cwcongdo/oneAPI-samples-true/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp:99 + at Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp:99 99 q.submit([&](auto &h) { (gdb) ``` @@ -350,38 +433,36 @@ In case we need view code running on the GPU, we need to enable GPU debugging. 103 q.wait(); ``` - As you can see, there is something wrong in line 99. Unfortunately, the + Something wrong in line 99. Unfortunately, the ` Enqueue process failed` message we saw when it crashed does not really tell us anything other than our attempt to submit the `memcpy` to the device failed - Fortunately, in this case the two variables, `dev_c` and `c_back`, are - allocated only a few lines above line 99. In real code this might have - happened in another source file or library, so hunting down this issue is - going to be much harder. + Fortunately, in this case the two variables, `dev_c` and `c_back`, are allocated only a few lines above line 99. In real code this might have happened in another source file or library, so hunting down this issue is going to be much harder. - Look at the source, and note that `dev_c` is defined as a pointer to device memory allocated on queue `q2`: + Look at the source, and note that `dev_c` is defined as a pointer to device memory allocated on queue `q2` (we noticed this with Address Sanitizer): ``` - float * dev_c = sycl::malloc_device(M*P, q2); + 82 float * dev_c = sycl::malloc_device(M*P, q2); ``` and `c_back` is defined as local memory ``` - float(*c_back)[P] = new float[M][P]; + 49 float(*c_back)[P] = new float[M][P]; ``` 8. Look at line 99, and notice the discrepancy. ``` - q.submit([&](auto &h) { + 99 q.submit([&](auto &h) { ``` - Variable `dev_c` was allocated on queue `q2` while the submit statement is - being done on queue `q`. + Variable `dev_c` was allocated on queue `q2` while the submit statement is being done on queue `q`. These queues are created using deferent devices contexts (the default one, and `devicecontext`) + + So unlike what Address Sanitizer suggested, the problem was first noticed in line 99, not 106. The debugger stopped immediately, while Address Sanitizer took a moment longer to spot the problem/respond to the exception. ### Identify the Problem without Code Inspection -You must have already built the [Unified Tracing and Profiling Tool](#getting-the-tracing-and-profiling-tool). Once you have built the utility, you can start it before your program (similar to using GBD). +You need to build the [Unified Tracing and Profiling Tool](#getting-the-tracing-and-profiling-tool) before completing this section. Once you have built the utility, you can start it before your program (similar to using GBD). One of the things that the Unified Tracing and Profiling utility can help us see is every low-level API call made to OpenCL™ or Level Zero. We will use it to attempt to match the source to the events. @@ -407,7 +488,7 @@ is every low-level API call made to OpenCL™ or Level Zero. We will use it to a `src_ptr` into device memory `dst_ptr = 0xff00ffffffeb0000` (NOTE: in some versions of `unitrace` these addresses may be returned in decimal rather than hexidecimal). Working back up the trace, you can see we allocated the destination device memory with the address `0xff00ffffffeb0000` using context `0x49dbff0` (line 16). However, - the command queue (`0x49d7130`) being used in the `clEnqueueMemcpyINTEL` + the command queue (`0x49d7130`) being used in the `clEnqueueMemcpyINTEL` call was created using the context `0x488d190` (line 4), which is different from the context used to allocate the destination device memory (`0x49dbff0` - line 16 again). The generic error we get is the OpenCL @@ -422,7 +503,7 @@ is every low-level API call made to OpenCL™ or Level Zero. We will use it to a For comparison, an example of legal memory copy where the device context (`0x488d190`) used for the command queue (`0x49d7130`) is the same as that - uses for the memory allocation is shown as well (lines 4, 7, 19). + used for the memory allocation is shown as well (lines 4, 7, 19). 2. Let's also look at the output from Level Zero, and see if we could have detected the issue there: diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/CMakeLists.txt b/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/CMakeLists.txt index 27cbc5ac7f..3410793a23 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/CMakeLists.txt +++ b/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.4) +cmake_minimum_required (VERSION 3.5) set (CMAKE_CXX_COMPILER "icpx") project (matrix_mul LANGUAGES CXX) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md index e9b49d530f..2bce82e253 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md @@ -31,8 +31,8 @@ The sample includes different versions of a simple matrix multiplication program |:--- |:--- | OS | Ubuntu* 24.04 LTS | Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.1
Intel® Distribution for GDB* 2025.1
Unified Tracing and Profiling Tool 2.1.2, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Rolling Release driver 2507.12 or later from https://dgpu-docs.intel.com/releases/releases.html +| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -133,9 +133,9 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -At a step in this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). -To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install ). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). +To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). ### Examine the Original Code @@ -171,7 +171,7 @@ In case we need view code running on the GPU, we need to enable GPU debugging. intelgt: inferior 3 (gdbserver-ze) has been removed. (gbd) ``` - As we saw outside the debugger, it ran to completion. But note that the inferior (the code running on the GPU), exited with an error code (0377). Let's see if we can trap that error. + As we saw outside the debugger, it ran to completion. But note that the inferior (the code running on the GPU), exited with an error code (`0377`). Let's see if we can trap that error. 4. Run again, telling the debugger to stop if the application throws an exception ``` @@ -208,11 +208,7 @@ In case we need view code running on the GPU, we need to enable GPU debugging. from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 #3 0x00007ffff7e2b73c in sycl::_V1::detail::MemoryManager::copy(sycl::_V1::detail::SYCLMemObjI*, void*, std::shared_ptr, unsigned int, sycl::_V1::range<3>, sycl::_V1::range<3>, sycl::_V1::id<3>, unsigned int, void*, std::shared_ptr, unsigned int, sycl::_V1::range<3>, sycl::_V1::range<3>, sycl::_V1::id<3>, unsigned int, std::vector >, ur_event_handle_t_*&, std::shared_ptr const&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #4 0x00007ffff7eb31e9 in ur_result_t sycl::_V1::detail::callMemOpHelper, unsigned int, sycl::_V1::range<3>, sycl::_V1::range<3>, sycl::_V1::id<3>, unsigned int, void*, std::shared_ptr, unsigned int, sycl::_V1::range<3>, sycl::_V1::range<3>, sycl::_V1::id<3>, unsigned int, std::vector >, ur_event_handle_t_*&, std::shared_ptr const&), sycl::_V1::detail::SYCLMemObjI*, void*, std::shared_ptr&, unsigned int&, sycl::_V1::range<3>&, sycl::_V1::range<3>&, sycl::_V1::id<3>&, unsigned int&, void*&, std::shared_ptr&, unsigned int&, sycl::_V1::range<3>&, sycl::_V1::range<3>&, sycl::_V1::id<3>&, unsigned int&, std::vector >, ur_event_handle_t_*&, std::shared_ptr&>(void (&)(sycl::_V1::detail::SYCLMemObjI*, void*, std::shared_ptr, unsigned int, sycl::_V1::range<3>, sycl::_V1::range<3>, sycl::_V1::id<3>, unsigned int, void*, std::shared_ptr, unsigned int, sycl::_V1::range<3>, sycl::_V1::range<3>, sycl::_V1::id<3>, unsigned int, std::vector >, ur_event_handle_t_*&, std::shared_ptr const&), sycl::_V1::detail::SYCLMemObjI*&&, void*&&, std::shared_ptr&, unsigned int&, sycl::_V1::range<3>&, sycl::_V1::range<3>&, sycl::_V1::id<3>&, unsigned int&, void*&, std::shared_ptr&, unsigned int&, sycl::_V1::range<3>&, sycl::_V1::range<3>&, sycl::_V1::id<3>&, unsigned int&, std::vector >&&, ur_event_handle_t_*&, std::shared_ptr&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #5 0x00007ffff7eb2c4e in sycl::_V1::detail::MemCpyCommandHost::enqueueImp() () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #6 0x00007ffff7ea90fb in sycl::_V1::detail::Command::enqueue(sycl::_V1::detail::EnqueueResultT&, sycl::_V1::detail::BlockingT, std::vector >&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #7 0x00007ffff7ecec2e in sycl::_V1::detail::Scheduler::GraphProcessor::enqueueCommand(sycl::_V1::detail::Command*, std::shared_lock&, sycl::_V1::detail::EnqueueResultT&, std::vector >&, sycl::_V1::detail::Command*, sycl::_V1::detail::BlockingT) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 + : #8 0x00007ffff7eca5ba in sycl::_V1::detail::Scheduler::addCopyBack(sycl::_V1::detail::AccessorImplHost*) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 #9 0x00007ffff7edd2e6 in sycl::_V1::detail::SYCLMemObjT::updateHostMemory(void*) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 #10 0x00007ffff7eebdd3 in std::_Function_handler const&), sycl::_V1::detail::SYCLMemObjT::handleHostData(void*, unsigned long)::{lambda(std::function const&)#1}>::_M_invoke(std::_Any_data const&, std::function const&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 @@ -261,6 +257,8 @@ In case we need view code running on the GPU, we need to enable GPU debugging. 133 } ``` + So we crashed in the last line of the program while we were cleaning up. But if you look closely at the stack above, you will see that we were also in the middle of a copy from the device to the host (frame 2). + 8. Exit the debugger. 9. Run the program using the [Unified Tracing and Profiling Tool](#getting-the-tracing-and-profiling-tool) tool. @@ -289,56 +287,59 @@ In case we need view code running on the GPU, we need to enable GPU debugging. ### Interpret the Results -The first clue here is that the program throws an exception after it has completed checking the results and finding them bad. That behavior is worrying. +The first clue here is that the program throws an exception *after* it has completed checking the results and finding them bad. That behavior is worrying. Next, looking at the crash in the debugger, there are a couple of odd things that stand out. Look at stack `frame 9`. This frame shows us attempting to update the host memory from the device, while `frame 20` shows we are already at the end of the program and have started cleaning up the SYCL buffers (`frame 19`). The only variable containing data returned from the device is `c_back`. But the developer has already deleted `c_back` in line 126, so the *data the buffer being copied into (`c_back`) no longer exists*. We see something like this in the `unitrace` output above. The kernel is executed, the results are immediately checked, we create and wait on some events, and then the last thing we try to do before crashing is to copy some memory from the device memory (`srcptr = 18374967954634571776`) to a host pointer (`dstptr = 35936816`) that previously was used to initialize this same device memory (around line 101). Since `c_buf` is the only accessor that is defined as writeable in the `q.submit` at line 97, it again is a likely suspect. -But what if the developer didn't delete `c_back`, and let program termination clean it up? Try it! Unfortunately, in that case your program complains about bad results, but it exits cleanly (shutdown will wait for the GPU to copy memory back to the host buffer before it kills the buffer). +But what if the developer didn't delete `c_back`, and let program termination clean it up? Try it! + +Unfortunately, if you do this your program complains about bad results, but it exits cleanly (shutdown will wait for the GPU to copy memory back to the host buffer before it kills the buffer). Is the behavior different if you run it on OpenCL or Level 0? The default is to use the Level Zero run time, but we can explicitly force the use of either Level Zero or OpenCL, which can be helpful when troubleshooting. ``` ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./1_matrix_mul_race_condition + ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_race_condition ``` Unfortunately not; pretty much the same thing happens - they both produce incorrect results on exiting. -> **Note:** the command with OpenCL will only work if the `sycl-ls` command shows OpenCL -> devices for the graphics card, such as like this: +> **Note:** the command with OpenCL will only work if the `sycl-ls` command + shows OpenCL devices for the graphics card, such as like this: ``` - $ sycl-ls - [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] - [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] - [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] - [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] + $ sycl-ls + [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] + [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] + [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] + [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] + [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] + [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] + [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] ``` - If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): + > If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): ``` - export DRIVERLOC=/usr/lib/x86_64-linux-gnu - export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC - export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC + export DRIVERLOC=/usr/lib/x86_64-linux-gnu + export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC + export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC ``` -Similarly, we specify targeting the CPU, which sometimes can avoid problems in your code that are specific to offloading to the GPU. +Similarly, we an force the program to run on the CPU, which sometimes can avoid problems in your code that are specific to offloading to the GPU. ``` ONEAPI_DEVICE_SELECTOR=*:cpu ./1_matrix_mul_race_condition ``` This also has problems, but if you run this in the debugger you will see lots of threads all running in the third `q.submit` kernel, but no thread running `main`. This is because these threads have been abandoned when `main` deleted `c_back` and exited! -So in conclusion, it looks like the third kernel is still executing and/or its results are still being copied back to the host as the program is terminating. Which explains the incorrect results (they aren't available on the host yet) and the crash (results from the card are being copied to memory that has been deallocated). All these point to some sort of synchronization issue or race condition between the host and device. +So in conclusion, it looks like the third kernel is still executing and/or its results are still being copied back to the host as the program is terminating. Which explains the incorrect results (they aren't available on the host yet) and the crash (the card is trying to copy the results to memory on the host that has been deallocated). All these point to some sort of synchronization issue or race condition between the host and device. ### Understand the Problem -Because we are using SYCL buffers, even though the `q.submit` statements that populate `a_buf` and `b_buf` execute asynchronously, the third `q.submit` statement does not execute until those first two submits are complete because the SYCL runtime realizes that the third `q.submit` depends on the `a_buf` and `b_buf` buffers, which are being used in the first two kernels. Once the first two kernels complete, the third `q.submit` kernel starts executing because both its inputs are ready. The SYCL runtime then immediately returns control to the host and we proceed to the code which verifies the result - ***while the third `q.submit` keeps running***. +Because we are using SYCL buffers, even though the `q.submit` statements that populate `a_buf` and `b_buf` execute asynchronously, the third `q.submit` statement does not execute until those first two submits are complete because the SYCL runtime realizes that the third `q.submit` depends on the `a_buf` and `b_buf` buffers, which are being used in the first two kernels. Once the first two kernels complete, the third `q.submit` kernel starts executing because both its inputs are ready. The SYCL runtime then immediately returns control to the host program and we proceed to the code which verifies the result - ***while the third `q.submit` keeps running***. There are three errors in this code: @@ -346,7 +347,7 @@ There are three errors in this code: 2. We should be using a host accessor pointing to SYCL buffer `c_buf` to access its contents, which would also indicate that we need to wait for the third `q.submit kernel` to complete **and** for the *data to be copied back to the host* before accessing the data in `c_back`. -3. For buffers initialized with a pointer to host memory (like `c_buf`), the developer "makes a contract with the SYCL runtime" to not reference the host pointer again until the SYCL buffer is destroyed. Thus, deleting the host memory before the SYCL buffer is destroyed is illegal (the call to `delete[] c_back;`). The buffer cannot detect that the memory was deallocated. +3. For buffers initialized with a pointer to host memory (like `c_buf`), the developer "makes a contract with the SYCL runtime" to not reference the host pointer again until the SYCL buffer is destroyed. Thus, deleting the host memory before the SYCL buffer is destroyed is illegal (the call to `delete[] c_back;` is illegal because `c_buf` has not yet been deleted). The buffer cannot detect that the memory was deallocated. ### Fix the Code @@ -396,7 +397,7 @@ int i, j, k; : ``` The result should look like `3_matrix_mul.cpp`. Reiterating, with these changes : -1. We created a host accessor to pull the values of out `c_buf` on the host, forcing the data to be transferred from the device to the host before the first access (one of the race conditions in this code). +1. We created a host accessor to pull the values of out `c_buf` on the host, forcing the data to be transferred from the device to the host before the first access on the host (one of the race conditions in this code). 2. We waited for the third `q.submit` kernel to complete before asking for the values in `c_buf`, fixing the other race condition. 3. We are no longer deleting `c_back` before the SYCL buffer that makes use of it (`c_buf`) is destroyed on program exit. 4. We changed `VerifyResult` to pass down the host accessor, with which we are able to read the contents of the accessor the same way we would access the original `c_back` array (which we "made a contract" not to look at while a SYCL buffer was making use of it). @@ -449,7 +450,7 @@ Note that `2_matrix_mul.cpp` still has a bug. It is an example of problem (2) a This points out a potential trap in the training documentation you may have read while learning SYCL. You can easily get the impression that if you use the SYCL buffer-accessor mechanism, synchronization will be taken care of for you. The use of parenthesis may be mentioned in passing with little explanation. Even though the documentation may say "the { } block ensures all SYCL work has concluded," this is not stressed. -This is the trap of the SYCL buffer-accessor mechanism - you may assume that the automatic synchronization mechanism is smarter than it really is. In `1_matrix_mul_race_condition.cpp`, the SYCL runtime does not realize that we cannot call `VerifyResult` with the `c_back` array until the third `q.submit` kernel completes and the data are copied back to the host - it assumes you know what you are doing. +This is the trap of the SYCL buffer-accessor mechanism - you may assume that the automatic synchronization mechanism is smarter than it really is. In `1_matrix_mul_race_condition.cpp`, the SYCL runtime does not realize that we cannot access the `c_back` array in `VerifyResult` until the third `q.submit` kernel completes and the data are copied back to the host - it assumes you know what you are doing. >**Note**: You will find more on the proper use of buffers and accessors in the *Buffer Accessor Mode* section of the *[oneAPI GPU Optimization Guide Developer Guide](https://www.intel.com/content/www/us/en/docs/oneapi/optimization-guide-gpu/current/buffer-accessor-modes.html)*. diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/CMakeLists.txt b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/CMakeLists.txt index aa1d9e0811..bc3ed05a3b 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/CMakeLists.txt +++ b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.4) +cmake_minimum_required (VERSION 3.5) set (CMAKE_CXX_COMPILER "icpx") project (matrix_mul LANGUAGES CXX) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md index a146de4c8d..79e5dc4c03 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md @@ -14,7 +14,7 @@ The sample is a simple program that multiplies together two large matrices and v ## Purpose -The sample in this tutorial shows how to debug crashes that occur when the user tries to reserve more memory for a work-group than there is space in work-group local memory (also called [Shared Local Memory (SLM)](https://www.intel.com/content/www/us/en/docs/oneapi/optimization-guide-gpu/current/shared-local-memory.html). +The sample in this tutorial shows how to debug crashes that occur when the user tries to reserve more memory for a work-group than there is space in work-group local memory (also called [Shared Local Memory (SLM)](https://www.intel.com/content/www/us/en/docs/oneapi/optimization-guide-gpu/current/shared-local-memory.html)). Using this type of memory when working with GPUs is an important optimization, but you must be careful due to its limited size. Shared local memory is often also shared with/traded for Vector Engine memory registers. @@ -27,12 +27,12 @@ The sample includes different versions of a simple matrix multiplication program ## Prerequisites -| Optimized for | Description -|:--- |:--- +| Optimized for | Description +|:--- |:--- | OS | Ubuntu* 24.04 LTS | Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.1
Intel® Distribution for GDB* 2025.1
Unified Tracing and Profiling Tool 2.1.2, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Rolling Release driver 2507.12 or later from https://dgpu-docs.intel.com/releases/releases.html +| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -43,7 +43,7 @@ The basic SYCL* standards implemented in the code include the use of the followi - SYCL* kernels (including parallel_for function and explicit memory copies) - SYCL* queues -The type of error shown in this sample can be hard to detect and root cause in a large body of code where large amounts of data are passed due to the lack of tools that tell you what is actually going wrong, and because the resulting error message ("`PI_ERROR_OUT_OF_RESOURCES`") isn't informative. +The type of error shown in this sample can be hard to detect and root cause in a large body of code where large amounts of data are passed due to the lack of tools that tell you what is actually going wrong, and because the resulting error message ("`UR_RESULT_ERROR_OUT_OF_RESOURCES`") isn't informative. This can be particularly painful. For example, you might experience this error in the cases where code that runs on a device with a large amount of shared local memory fails on a device with less shared local memory, or where one data set out of many results in an allocation that exceeds SLM limits on a given machine. @@ -134,15 +134,15 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -At a step in this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). -To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install ). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). +To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). ### Check the Program In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illegal amount of device-local memory. If you attempt to run the code, the application will crash. -#### Observe the Failure +### Observe the Failure 1. Run the program outside the debugger. ``` @@ -160,11 +160,11 @@ In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illeg Device max work group size: 1024 Problem size: c(150,600) = a(150,300) * b(300,600) terminate called after throwing an instance of 'sycl::_V1::exception' - what(): UR backend failed. UR backend returns:40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Aborted (core dumped) ``` -#### Locate the General Location of the Problem +### Locate the General Location of the Problem 1. Start the debugger to learn more about the error. ``` @@ -175,14 +175,14 @@ In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illeg ``` (gdb) run ``` - When you get the error message `Debugging of GPU offloaded code is not enabled`, ignore it and answer `n` to the question `Quit anyway? (y or n)` + When you get the error message `Debugging of GPU offloaded code is not enabled`, ignore it and answer `n` to the question `Quit anyway? (y or n)`. You may need to do this more than once. If the error happens further in the program, you may need to re-run with `ZET_ENABLE_PROGRAM_DEBUGGING=1` The application will fail and display the same message when we ran it outside of the debugger. ``` : Problem size: c(150,600) = a(150,300) * b(300,600) terminate called after throwing an instance of 'sycl::_V1::exception' - what(): UR backend failed. UR backend returns:40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Thread 1.1 "1_matrix_mul_SL" received signal SIGABRT, Aborted. (gdb) @@ -205,29 +205,23 @@ In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illeg #6 0x00007ffff78bb0da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff78a5a55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x00007ffff78bb391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 - #9 0x00007ffff7dcc4c9 in sycl::_V1::detail::enqueue_kernel_launch::handleOutOfResources(sycl::_V1::detail::device_impl const&, ur_kernel_handle_t_*, sycl::_V1::detail::NDRDescT const&) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #10 0x00007ffff7dd6214 in sycl::_V1::detail::enqueue_kernel_launch::handleErrorOrWarning(ur_result_t, sycl::_V1::detail::device_impl const&, ur_kernel_handle_t_*, sycl::_V1::detail::NDRDescT const&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #11 0x00007ffff7eb9b71 in sycl::_V1::detail::enqueueImpKernel(std::shared_ptr const&, sycl::_V1::detail::NDRDescT&, std::vector >&, std::shared_ptr const&, std::shared_ptr const&, std::__cxx11::basic_string, std::allocator > const&, std::vector >&, std::shared_ptr const&, std::function const&, ur_kernel_cache_config_t, bool, bool, unsigned long, sycl::_V1::detail::RTDeviceBinaryImage const*) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #12 0x00007ffff7f02e52 in sycl::_V1::handler::finalize()::$_0::operator()() const () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #13 0x00007ffff7effe3a in sycl::_V1::handler::finalize() () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #14 0x00007ffff7e84277 in void sycl::_V1::detail::queue_impl::finalizeHandler(sycl::_V1::handler&, sycl::_V1::event&) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #15 0x00007ffff7e832b7 in sycl::_V1::detail::queue_impl::submit_impl(std::function const&, std::shared_ptr const&, std::shared_ptr const&, std::shared_ptr const&, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::SubmissionInfo const&) - () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #16 0x00007ffff7e895c8 in sycl::_V1::detail::queue_impl::submit_with_event(std::function const&, std::shared_ptr const&, sycl::_V1::detail::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #17 0x00007ffff7f33afa in sycl::_V1::queue::submit_with_event_impl(std::function, sycl::_V1::detail::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #18 0x0000000000404f54 in sycl::_V1::queue::submit_with_event(main::{lambda(sycl::_V1::handler&)#1}, sycl::_V1::queue*, sycl::_V1::detail::code_location const&) (this=0x7fffffffb8f0, CGF=..., SecondaryQueuePtr=0x0, CodeLoc=...) at /opt/intel/oneapi/compiler/2025.1/bin/compiler/../../include/sycl/queue.hpp:2826 - #19 0x000000000040440c in sycl::_V1::queue::submit(main::{lambda(sycl::_V1::handler&)#1}, sycl::_V1::detail::code_location const&) ( - this=0x7fffffffb8f0, CGF=..., CodeLoc=...) at /opt/intel/oneapi/compiler/2025.1/bin/compiler/../../include/sycl/queue.hpp:365 - #20 0x0000000000403fe3 in main () at /nfs/site/home/cwcongdo/oneAPI-samples-true/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 + #9 0x00007ffff7dd78a5 in sycl::_V1::detail::enqueue_kernel_launch::handleOutOfResources(sycl::_V1::detail::device_impl const&, ur_kernel_handle_t_*, sycl::_V1::detail::NDRDescT const&) () + from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 + #10 0x00007ffff7de164a in sycl::_V1::detail::enqueue_kernel_launch::handleErrorOrWarning(ur_result_t, sycl::_V1::detail::device_impl const&, ur_kernel_handle_t_*, sycl::_V1::detail::NDRDescT const&) () + from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 + : + #19 0x0000000000407e62 in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb580, Props=..., CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:3762 + #20 0x00000000004043e9 in sycl::_V1::queue::submit(main::{lambda(sycl::_V1::handler&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb580, CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:429 + #21 0x0000000000403fa3 in main () + at Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 ``` 4. Look at the final frame. (Your frame number might differ, and you might have to repeat this command to get the frame to change). ``` - (gdb) frame 20 - #20 0x0000000000403fe3 in main () at /nfs/site/home/cwcongdo/oneAPI-samples-true/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 + (gdb) frame 21 + #21 0x0000000000403fe3 in main () at Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 104 q.submit([&](handler &h){ (gdb) ``` @@ -254,7 +248,7 @@ In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illeg Now exit the debugger. -#### Root-Cause the Issue +### Root-Cause the Issue You can see that there is something wrong in the submit at line `104`, but we need more information to understand what is happening. For that we need to capture the lower-level API calls using the `unitrace` tool. @@ -270,16 +264,16 @@ Among other things, the Tracing and Profiling utility can print every low-level 3. Let the output continue until the error occurs and the program stops. ``` : - >>>> [776257970958971] zeKernelSetGroupSize: hKernel = 54646808 groupSizeX = 10 groupSizeY = 1 groupSizeZ = 1 - <<<< [776257970963072] zeKernelSetGroupSize [1237 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [776257970967552] zeCommandListCreateImmediate: hContext = 53065840 hDevice = 48614248 altdesc = 140735243323376 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 140735243323360 (hCommandList = 0) - <<<< [776257971129090] zeCommandListCreateImmediate [157138 ns] hCommandList = 54788792 -> ZE_RESULT_SUCCESS(0x0) - >>>> [776257971135996] zeEventHostReset: hEvent = 49803640 - <<<< [776257971139385] zeEventHostReset [1296 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [776257972254927] zeCommandListAppendLaunchKernel: hCommandList = 54788792 hKernel = 54646808 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 140735243324504 {16385, 1, 1} hSignalEvent = 49803640 numWaitEvents = 0 phWaitEvents = 0 - <<<< [776257972338436] zeCommandListAppendLaunchKernel [56440 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) + >>>> [806881439215102] zeKernelSetGroupSize: hKernel = 0x2a54be8 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 + <<<< [806881439220367] zeKernelSetGroupSize [1631 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [806881439225163] zeCommandListCreateImmediate: hContext = 0x29cd578 hDevice = 0x2936ee8 altdesc = 0x7ffcce631850 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 0x7ffcce631838 (hCommandList = 0x0) + <<<< [806881439391714] zeCommandListCreateImmediate [160772 ns] hCommandList = 0x2d3b218 -> ZE_RESULT_SUCCESS(0x0) + >>>> [806881439399881] zeEventHostReset: hEvent = 0x2cd8a88 + <<<< [806881439403570] zeEventHostReset [1577 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [806881439411094] zeCommandListAppendLaunchKernel: hCommandList = 0x2d3b218 hKernel = 0x2a54be8 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7ffcce631d78 {16385, 1, 1} hSignalEvent = 0x2cd8a88 numWaitEvents = 0x0 phWaitEvents = 0x0 + <<<< [806881439467224] zeCommandListAppendLaunchKernel [47029 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) terminate called after throwing an instance of 'sycl::_V1::exception' - what(): UR backend failed. UR backend returns:40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Aborted (core dumped) ``` @@ -288,16 +282,16 @@ Among other things, the Tracing and Profiling utility can print every low-level A note about the output above. You will see that is has two lines that read: ``` - >>>> [776257970958971] zeKernelSetGroupSize: hKernel = 54646808 groupSizeX = 10 groupSizeY = 1 groupSizeZ = 1 + >>>> [806881439215102] zeKernelSetGroupSize: hKernel = 0x2a54be8 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 : - >>>> [776257972254927] zeCommandListAppendLaunchKernel: hCommandList = 54788792 hKernel = 54646808 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 140735243324504 {16385, 1, 1} hSignalEvent = 49803640 numWaitEvents = 0 phWaitEvents = 0 + >>>> [806881439411094] zeCommandListAppendLaunchKernel: hCommandList = 0x2d3b218 hKernel = 0x2a54be8 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7ffcce631d78 {16385, 1, 1} hSignalEvent = 0x2cd8a88 numWaitEvents = 0x0 phWaitEvents = 0x0 ``` - We used the form of `parallel_for` that takes the `nd_range`, which specifies the global iteration range (163850) and the local work-group size (10) like so: `nd_range<1>{{163850}, {10}}`. The first line above shows the workgroup size (`groupSizeX = 10 groupSizeY = 1 groupSizeZ = 1`), and the second shows how many total workgroups will be needed to process the global iteration range (`{16385, 1, 1}`). + We used the form of `parallel_for` that takes the `nd_range`, which specifies the global iteration range (163850) and the local work-group size (10) like so: `nd_range<1>{{163850}, {10}}`. The first line above shows the workgroup size (`groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1`), and the second shows how many total workgroups will be needed to process the global iteration range (`{16385, 1, 1}`). -#### Determine Device Limits +### Determine Device Limits -If you have access to a version of the graphics drivers built with debug functionality, you can get even more information about this error by setting two NEO variables to the following values: +If you have access to a version of the graphics drivers built with debug functionality, you can get even more information about this error by setting two "NEO" variables to the following values: ``` export NEOReadDebugKeys=1 @@ -324,7 +318,7 @@ Aborted (core dumped) The new message of interest is `Size of SLM (656384) larger than available (131072)`. This tells you that the size of the Shared Local Memory (SLM) memory on the device, 131072 bytes (128Kb), is smaller than the requested size of 656384 bytes (641Kb). -If the `parallel_for` were operating over a multi-dimensional range (for example, if `acc` were two or three-dimensional), you need to multiply the dimensions together to determine the number of floating point numbers we are trying to store in SLM. In our case, the calculation is easy: the first argument to the `nd_range` in the `parallel_for` is single-dimensional, so it's just 163850. Thus the problem is that the size of work-group local memory we tried to allocate, (163850 floats or 4*163850=655,400 bytes rounded up to the nearest 64-byte cache line), doesn't fit in the SLM on this device. +If the `parallel_for` were operating over a multi-dimensional range (for example, if `acc` were two or three-dimensional), you will need to multiply the dimensions together to determine the number of floating point numbers we are trying to store in SLM. In our case, the calculation is easy: the first argument to the `nd_range` in the `parallel_for` is single-dimensional, so it's just 163850. Thus the problem is that the size of work-group local memory we tried to allocate, (163850 floats or 4*163850=655,400 bytes rounded up to the nearest 64-byte cache line), doesn't fit in the SLM on this device. You should know that different devices will have different amounts of memory set aside as SLM. In SYCL, you can query this number by passing `info::device::local_mem_size` to the `get_info` member of the `device` class. @@ -332,27 +326,27 @@ Finally, running under `unitrace -c` you see: ``` : ->>>> [776708418226802] zeKernelSetGroupSize: hKernel = 57133096 groupSizeX = 10 groupSizeY = 1 groupSizeZ = 1 -<<<< [776708418230893] zeKernelSetGroupSize [1154 ns] -> ZE_RESULT_SUCCESS(0x0) ->>>> [776708418235549] zeCommandListCreateImmediate: hContext = 55553168 hDevice = 51101560 altdesc = 140722633379296 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 140722633379280 (hCommandList = 0) +>>>> [807184674868230] zeKernelSetGroupSize: hKernel = 0x257bbe8 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 +<<<< [807184674879934] zeKernelSetGroupSize [1560 ns] -> ZE_RESULT_SUCCESS(0x0) +>>>> [807184674884930] zeCommandListCreateImmediate: hContext = 0x24f4578 hDevice = 0x245e2f8 altdesc = 0x7ffeb187b880 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 0x7ffeb187b868 (hCommandList = 0x0) Flush Task for Immediate command list : Enabled -Using PCI barrier ptr: 0x141f77d49000 -<<<< [776708418401199] zeCommandListCreateImmediate [160724 ns] hCommandList = 57275080 -> ZE_RESULT_SUCCESS(0x0) ->>>> [776708418408270] zeEventHostReset: hEvent = 52290952 -<<<< [776708418411693] zeEventHostReset [997 ns] -> ZE_RESULT_SUCCESS(0x0) ->>>> [776708418417397] zeCommandListAppendLaunchKernel: hCommandList = 57275080 hKernel = 57133096 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 140722633380424 {16385, 1, 1} hSignalEvent = 52290952 numWaitEvents = 0 phWaitEvents = 0 +Using PCI barrier ptr: 0xbbbf8206000 +<<<< [807184675059549] zeCommandListCreateImmediate [169347 ns] hCommandList = 0x2862218 -> ZE_RESULT_SUCCESS(0x0) +>>>> [807184675067615] zeEventHostReset: hEvent = 0x27ffa88 +<<<< [807184675071317] zeEventHostReset [1401 ns] -> ZE_RESULT_SUCCESS(0x0) +>>>> [807184675077771] zeCommandListAppendLaunchKernel: hCommandList = 0x2862218 hKernel = 0x257bbe8 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7ffeb187bda8 {16385, 1, 1} hSignalEvent = 0x27ffa88 numWaitEvents = 0x0 phWaitEvents = 0x0 Size of SLM (656384) larger than available (131072) -<<<< [776708418485438] zeCommandListAppendLaunchKernel [60634 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) +<<<< [807184675135249] zeCommandListAppendLaunchKernel [48600 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) terminate called after throwing an instance of 'sycl::_V1::exception' - what(): UR backend failed. UR backend returns:40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Aborted (core dumped) ``` -This is useful because it shows you the kernel being called that caused the error (`_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_` which `c++filt` resolves to `typeinfo name for main::{lambda(sycl::_V1::handler&)#1}::operator()(sycl::_V1::handler&) const::{lambda(sycl::_V1::nd_item<1>)#1} `) in addition to the amount of memory requested vs. the available size of SLM. +This is useful because it shows you the kernel being called that caused the error (`_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_` which `c++filt` resolves to `typeinfo name for main::{lambda(sycl::_V1::handler&)#1}::operator()(sycl::_V1::handler&) const::{lambda(sycl::_V1::nd_item<1>)#1} `) in addition to the amount of memory requested vs. the available size of SLM. So now we know for sure that the problem was in fact in the lambda function located by the debugger in addition to the reason for the error. -#### Resolving the Problem +### Resolving the Problem The synthetic code in this example has nothing to do with matrix multiply and can simply be removed to resolve the problem, so you can delete code to solve the problem. From 0890f6f121a8c37e213177eabb4d48727ef3646e Mon Sep 17 00:00:00 2001 From: Tony Feng <103078747+chuanyuf@users.noreply.github.com> Date: Thu, 28 May 2026 21:57:37 -0500 Subject: [PATCH 4/4] Merge pull request #2747 from CharlesCongdon/cc_tutupdate20260 Updates for oneAPI 2026.0 tools and drivers --- .../guided_matrix_mult_BadBuffers/README.md | 25 +- .../src/b1_matrix_mul_null_usm.cpp | 4 + .../src/b2_matrix_mul_usm.cpp | 4 + .../guided_matrix_mult_Exceptions/README.md | 50 +- .../src/1_matrix_mul_null_pointer.cpp | 4 + .../src/2_matrix_mul_multi_offload.cpp | 4 + .../src/3_matrix_mul.cpp | 4 + .../README.md | 433 ++++++++++++------ .../src/1_matrix_mul_invalid_contexts.cpp | 31 +- .../src/2_matrix_mul.cpp | 17 + .../README.md | 47 +- .../guided_matrix_mult_SLMSize/README.md | 78 ++-- .../src/1_matrix_mul_SLM_size.cpp | 4 + .../src/2_matrix_mul.cpp | 4 + 14 files changed, 479 insertions(+), 230 deletions(-) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md index 9c8398b822..fe92dbbd9e 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md @@ -1,6 +1,6 @@ # `Guided Matrix Multiplication Bad Buffers` Sample -The `Guided Matrix Multiplication Bad Buffers` sample demonstrates how to use several tools in the Intel® oneAPI Base Toolkit (Base Kit) to triage incorrect use of the SYCL language. +The `Guided Matrix Multiplication Bad Buffers` sample demonstrates how to use several tools in Intel® oneAPI to triage incorrect use of the SYCL language. The sample is a simple program that multiplies together two large matrices and verifies the results. @@ -31,9 +31,9 @@ The sample includes different versions of a simple matrix multiplication program | Optimized for | Description |:--- |:--- | OS | Ubuntu* 24.04 LTS -| Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html +| Intel Graphics Hardware | GEN9 or newer +| Software | Intel® oneAPI DPC++/C++ Compiler 2026.0
Intel® Distribution for GDB* 2026.0
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.59 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -46,7 +46,7 @@ The basic SYCL* standards implemented in the code include the use of the followi ## Set Environment Variables -When working with the command-line interface (CLI), configure the oneAPI toolkit environment variables. Set up your CLI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development. +When working with the command-line interface (CLI), set up your oneAPI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development. ## Build the `Guided Matrix Multiplication Bad Buffers` Programs @@ -121,7 +121,6 @@ the `VERBOSE=1` argument: ``` make VERBOSE=1 ``` -If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the *[Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html)* for more information on using the utility. ## Guided Debugging @@ -129,7 +128,7 @@ If you receive an error message, troubleshoot the problem using the **Diagnostic These instructions assume you have installed the Intel® Distribution for GDB* and have a basic working knowledge of GDB. ### Setting up to Debug on the GPU -To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GDB-PVC debugger](https://dgpu-docs.intel.com/system-user-guides/DNP-Max-1100-userguide/DNP-Max-1100-userguide.html#gdb-pvc-debugger)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. +To learn how setup and use the Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GPU Debugging](https://dgpu-docs.intel.com/driver/gpu-debugging.html)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. Documentation on using the debugger in a variety of situations can be found at *[Debug Examples in Linux](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/current/overview.html)* @@ -137,12 +136,12 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI. To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). ### Guided Instructions for Zero Buffer using Address Sanitizer -A recent addition to the oneAPI compiler is that ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application. +The oneAPI compiler has the ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application. 1. Compile a version of the program with device-side Address Sanitizer (assuming that you are in the `build` directory) ``` @@ -198,7 +197,7 @@ A recent addition to the oneAPI compiler is that ability to use the "Address San ### Guided Instructions for Zero Buffer using gdb-oneapi and the OpenCL CPU device -In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `lambda` function. **This will cause the application to crash.** We saw in the previous section how we can catch this with the device-side Address Sanitizer. But what if the bad array allocation occured somewhere else deep in the program? How would we track the problem back to its source? Let's try one technique to locate the source of the error. +In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `lambda` function. **This will cause the application to crash.** We saw in the previous section how we can catch this with the device-side Address Sanitizer. But what if the bad array allocation occurred somewhere else deep in the program? How would we track the problem back to its source? Let's try one technique to locate the source of the error. 1. Run the program without the debugger. @@ -353,7 +352,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` 0}}, static dimensions = }, MOffset = {> = {common_array = {0, 0}}, static dimensions = }}} ``` - Clearly there is a mismatch here! 'a' has no space reserved for it, yet we will be iterating over 150 by 300 elements (and updating element 131 by 0 in this thread), which is clearly an error. + Clearly there is a mismatch here: 'a' has no space reserved for it, yet we will be iterating over 150 by 300 elements (and updating element 131 by 0 in this thread), which is clearly an error. 9. To further root-cause the error, we will need to restart the program and look at the values of the buffers behind the accessors (`a_buf` and `b_buf`), which are not in scope in any of our stack frames. We'll set some breakpoints at the `parallel_for` statements where they are initialized. @@ -416,7 +415,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit ` ``` ### Guided Instructions for Null Device Pointer using Address Sanitizer -Let us use the Address Sanitizer again to catch invalid pointer addresses at runtime, this time in code that makes use of explicit device memory allocations rather than using SYCL buffers. This will require a special build of the application. +Let us use the Address Sanitizer again to catch invalid pointer addresses at runtime, this time in code that makes use of explicit device-memory allocations rather than using SYCL buffers. This will require a special build of the application. 1. Compile a version of the program with device-side Address Sanitizer (assuming that you are in the `build` directory) ``` @@ -544,7 +543,7 @@ In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is suppo #### Debugging the Problem -Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests as something that goes terribly wrong. Or one of the backbends might have a bug while the others do not. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address `0x0`, while this may be legally allocated memory on the GPU. +Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests when something goes terribly wrong. Or one of the backbends might have a bug while the others do not. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address `0x0`, while this may be legally allocated memory on the GPU. Another reason to try different backends is that debugging support may differ between different GPU drivers and/or different GPU models. Debugging the program using the OpenCL™ CPU driver gets around these issues. diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b1_matrix_mul_null_usm.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b1_matrix_mul_null_usm.cpp index e7841aec86..546e37050e 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b1_matrix_mul_null_usm.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b1_matrix_mul_null_usm.cpp @@ -132,6 +132,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b2_matrix_mul_usm.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b2_matrix_mul_usm.cpp index ac97b65b23..503265f223 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b2_matrix_mul_usm.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b2_matrix_mul_usm.cpp @@ -130,6 +130,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md index dd8b72569f..b191c422a1 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/README.md @@ -1,6 +1,6 @@ # `Guided Matrix Multiplication Exception` Sample -The `Guided Matrix Multiplication Exception` sample demonstrates a guided approach to debugging SYCL exceptions from incorrect use of the SYCL* API. It uses the Intel® oneAPI Base Toolkit (Base Kit) and several tools included in the Base Kit. +The `Guided Matrix Multiplication Exception` sample demonstrates an approach to debugging SYCL exceptions from incorrect use of the SYCL* API using several tools in Intel® oneAPI. The sample code is a simple program that multiplies together two large matrices and verifies the results. @@ -34,9 +34,9 @@ The sample includes three different versions of some simple matrix multiplicatio | Optimized for | Description |:--- |:--- | OS | Ubuntu* 24.04 LTS -| Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3 -| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html +| Intel Graphics Hardware | GEN9 or newer +| Software | Intel® oneAPI DPC++/C++ Compiler 2026.0
Intel® Distribution for GDB* 2026.0 +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.59 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -50,7 +50,7 @@ The basic SYCL* standards implemented in the code include the use of the followi ## Set Environment Variables -When working with the command-line interface (CLI), you should configure the oneAPI toolkits using environment variables. Set up your CLI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries, and tools are ready for development. +When working with the command-line interface (CLI), set up your oneAPI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development. ## Build and Run the `Guided Matrix Multiplication Exception` Programs @@ -121,7 +121,6 @@ the `VERBOSE=1` argument: ``` make VERBOSE=1 ``` -If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the *[Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html)* for more information on using the utility. ## Guided Debugging @@ -129,7 +128,7 @@ If you receive an error message, troubleshoot the problem using the **Diagnostic These instructions assume you have installed the Intel® Distribution for GDB* and have a basic working knowledge of GDB. ### Setting up to Debug on the GPU -To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GDB-PVC debugger](https://dgpu-docs.intel.com/system-user-guides/DNP-Max-1100-userguide/DNP-Max-1100-userguide.html#gdb-pvc-debugger)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. +To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GPU Debugging](https://dgpu-docs.intel.com/driver/gpu-debugging.html)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. Documentation on using the debugger in a variety of situations can be found at *[Debug Examples in Linux](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/current/overview.html)* @@ -236,7 +235,7 @@ In the second version, the code attempts to execute more than one offload statem (gdb) backtrace ``` -4. Notice in the results (which should look something like the following) that the exception (frame 8) was triggered around line 98 (frame 17): +4. Notice in the results (which should look something like the following) that the exception (frame 8) was triggered around line 98 (frame 16): ``` #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=) at ./nptl/pthread_kill.c:78 @@ -247,30 +246,29 @@ In the second version, the code attempts to execute more than one offload statem #6 0x00007ffff78bb0da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff78a5a55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x00007ffff78bb391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 - #9 0x00007ffff7f11ed0 in sycl::_V1::handler::memcpy(void*, void const*, unsigned long) () - from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 - #10 0x0000000000404812 in main::{lambda(auto:1&)#1}::operator()(sycl::_V1::handler&) const ( - this=0x7fffffffb098, h=sycl::handler& = {...}) + #9 0x00007ffff7f13f61 in sycl::_V1::handler::memcpy(void*, void const*, unsigned long) () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #10 0x0000000000404762 in main::{lambda(auto:1&)#1}::operator()(sycl::_V1::handler&) const ( + this=0x7fffffffb318, h=sycl::handler& = {...}) at Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp:100 - #11 0x00000000004047ad in sycl::_V1::detail::type_erased_cgfo_ty::invoker::call(void const*, sycl::_V1::handler&) (object=0x7fffffffb098, cgh=sycl::handler& = {...}) - at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/handler.hpp:190 - #12 0x00007ffff7e8a4a4 in sycl::_V1::detail::queue_impl::submit_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::queue_impl*, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::v1::SubmissionInfo const&) () from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 - #13 0x00007ffff7e90022 in sycl::_V1::detail::queue_impl::submit_with_event(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::v1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () - from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 - #14 0x00007ffff7f58844 in sycl::_V1::queue::submit_with_event_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::v1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) const () - from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 - #15 0x0000000000407392 in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb570, Props=..., CGF=..., CodeLoc=...) - at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:3762 - #16 0x00000000004042a1 in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb570, CGF=..., CodeLoc=...) - at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:429 - #17 0x0000000000403eac in main () + #11 0x00000000004046fd in sycl::_V1::detail::type_erased_cgfo_ty::invoker::call(void const*, sycl::_V1::handler&) (object=0x7fffffffb318, cgh=sycl::handler& = {...}) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/handler.hpp:191 + #12 0x00007ffff7e92c6d in sycl::_V1::detail::queue_impl::submit_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::_V1::SubmissionInfo const&) () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #13 0x00007ffff7f58ac9 in sycl::_V1::queue::submit_with_event_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::_V1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) const () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #14 0x00000000004072be in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb780, Props=..., CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:3700 + #15 0x00000000004041f1 in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb780, CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:441 + #16 0x0000000000403e7c in main () at Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp:98 ``` 5. Examine the last frame (it may be different from the output above) using the following command: ``` - (gdb) frame 17 + (gdb) frame 16 ``` You may need to issue this command twice before you see output similar to the following example: ``` @@ -294,7 +292,7 @@ In the second version, the code attempts to execute more than one offload statem As the exception reported, we are trying to do two memory copies to the device within the `submit` statement, where only a single `parallel_for` or `memcpy` is allowed. -7. To fix the error, remove the extra `memcpy` from the code above. If this statement were actually issuing two different `memcpy` statements, you would update the code to break this up into two `submit` statements, each with a single `memcpy` . +7. To fix the error, remove the extra `memcpy` from the code above (as in `3_matrix_mul.cpp`). If this statement were actually issuing two different `memcpy` statements, you would update the code to break this up into two `submit` statements, each with a single `memcpy` . ``` q.submit([&](auto &h) { h.memcpy(); diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/1_matrix_mul_null_pointer.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/1_matrix_mul_null_pointer.cpp index 6d390a7a63..355b45a475 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/1_matrix_mul_null_pointer.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/1_matrix_mul_null_pointer.cpp @@ -130,6 +130,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp index fe8b9b85e4..98f38d6af3 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/2_matrix_mul_multi_offload.cpp @@ -131,6 +131,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/3_matrix_mul.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/3_matrix_mul.cpp index ac97b65b23..503265f223 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/3_matrix_mul.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_Exceptions/src/3_matrix_mul.cpp @@ -130,6 +130,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md index 7bca9f4b79..d2621a7a34 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/README.md @@ -1,8 +1,6 @@ # `Guided Matrix Multiplication Invalid Contexts` Sample -The `Guided Matrix Multiplication Invalid Contexts` sample demonstrates how to -use the Intel® oneAPI Base Toolkit (Base Kit) and several tools found in it to -triage incorrect use of the SYCL language. +The `Guided Matrix Multiplication Invalid Contexts` sample demonstrates how to use several tools in Intel® oneAPI to triage incorrect use of the SYCL language. The sample is a simple program that multiplies together two large matrices and verifies the results. @@ -40,9 +38,9 @@ program. | Optimized for | Description |:--- |:--- | OS | Ubuntu* 24.04 LTS -| Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html +| Intel GraphicsHardware | GEN9 or newer +| Software | Intel® oneAPI DPC++/C++ Compiler 2026.0
Intel® Distribution for GDB* 2026.0
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.59 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -59,11 +57,7 @@ following: ## Set Environment Variables -When working with the command-line interface (CLI), you should configure the -oneAPI toolkits using environment variables. Set up your CLI environment by -sourcing the `setvars` script every time you open a new terminal window. This -practice ensures that your compiler, libraries, and tools are ready for -development. +When working with the command-line interface (CLI), set up your oneAPI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development. ## Build and Run the `Guided Matrix Multiplication Invalid Contexts` Programs @@ -146,8 +140,6 @@ the `VERBOSE=1` argument: make VERBOSE=1 ``` -If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the *[Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html)* for more information on using the utility. - ## Guided Debugging @@ -155,7 +147,7 @@ The following instructions assume you have installed Intel® Distribution for GDB* and have a basic working knowledge of GDB. ### Setting up to Debug on the GPU -To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GDB-PVC debugger](https://dgpu-docs.intel.com/system-user-guides/DNP-Max-1100-userguide/DNP-Max-1100-userguide.html#gdb-pvc-debugger)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. +To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GPU Debugging](https://dgpu-docs.intel.com/driver/gpu-debugging.html)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. Documentation on using the debugger in a variety of situations can be found at *[Debug Examples in Linux](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/current/overview.html)* @@ -163,16 +155,28 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with Intel® oneAPI. To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). ### Check the Programs -1. Notice that both versions of the application run to completion and report - correct results. +1. Notice that both versions of the application (`1_matrix_mul_invalid_contexts` and `2_matrix_mul`) run to completion and report correct results. -2. SYCL applications use the Level Zero runtime by default with an Intel GPU. What happens if you use OpenCL™ software to run `1_matrix_mul_invalid_contexts` on the GPU? +2. Check the available compute devices available on your system using the `sycl-ls` command: + + ``` + $ sycl-ls + [level_zero:gpu][level_zero:0] Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Data Center GPU Max 1550 12.60.7 [1.6.33578+51] + [level_zero:gpu][level_zero:1] Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Data Center GPU Max 1550 12.60.7 [1.6.33578+51] + [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2026.21.3.0.31_160000] + [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [25.18.33578] + [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [25.18.33578] + [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] + ``` + > **Note:** If you have only one `[level_zero:gpu]` device listed, or the order is different from the above, the the main example below may not work. Try to follow through anyway, and then try the bonus sample at the end of this document, which should work no matter what system configuration. + +3. SYCL applications use the Level Zero runtime by default with an Intel GPU. But what happens if you use OpenCL™ runtime to run `1_matrix_mul_invalid_contexts` on the GPU? ``` ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_invalid_contexts @@ -194,21 +198,8 @@ To complete the steps in the following section, you must download the [Unified T Aborted (core dumped) ``` - > **Note:** this will only work if the `sycl-ls` command shows OpenCL - devices for the graphics card, such as like this: - - ``` - $ sycl-ls - [opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000] - [opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1550 OpenCL 3.0 NEO [24.22.29735.27] - [opencl:cpu][opencl:3] Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] - [opencl:fpga][opencl:4] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.7.0.21_160000] - [level_zero:gpu][level_zero:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - [level_zero:gpu][level_zero:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.29735] - ``` - - > If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): + > **Note:** you will only see the above if the `sycl-ls` command shows OpenCL + devices for the graphics card. If you are missing `[opencl:gpu]` devices you may have to add the necessary libraries to your device path by setting the appropriate path in `DRIVERLOC` and then running the following four commands (for Ubuntu - adapt for other OSes): ``` export DRIVERLOC=/usr/lib/x86_64-linux-gnu @@ -216,9 +207,11 @@ To complete the steps in the following section, you must download the [Unified T export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC ``` + + Then issue the `ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_invalid_contexts` command again to see the above error. -3. Check the results on the **CPU** using OpenCL. +4. Check the results on the **CPU** using OpenCL. ``` ONEAPI_DEVICE_SELECTOR=opencl:cpu ./1_matrix_mul_invalid_contexts @@ -226,7 +219,7 @@ To complete the steps in the following section, you must download the [Unified T Interestingly, this runs just fine. In the next sections we will try to explain the inconsistency. ### Guided Instructions for Zero Buffer using Address Sanitizer -A recent addition to the oneAPI compiler is that ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application. +The oneAPI compiler has the ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime *on the GPU rather* than the host. This will require a special build of the application. 1. Compile a version of the program with device-side address sanitizer (assuming that you are in the `build` directory) ``` @@ -239,30 +232,35 @@ A recent addition to the oneAPI compiler is that ability to use the "Address San ./1_matrix_mul_invalid_contexts_asan Initializing ==== DeviceSanitizer: ASAN + Devices: + [0] Intel(R) Data Center GPU Max 1550, 12.60.7 [1.6.33578+51] 1.6.33578+51, Intel(R) Corporation + [1] Intel(R) Data Center GPU Max 1550, 12.60.7 [1.6.33578+51] 1.6.33578+51, Intel(R) Corporation + [2] Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz, OpenCL 3.0 (Build 0) [2026.21.3.0.31_160000] 3.0, Intel(R) Corporation + [3] Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz, OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] 3.0, Intel(R) Corporation Computing - Device: Intel(R) Xeon(R) Platinum 8360Y CPU @ 2.40GHz - Device compute units: 144 - Device max work item size: 8192, 8192, 8192 - Device max work group size: 8192 + Device: Intel(R) Data Center GPU Max 1550 + Device compute units: 512 + Device max work item size: 1024, 1024, 1024 + Device max work group size: 1024 Problem size: c(150,600) = a(150,300) * b(300,600) ====ERROR: DeviceSanitizer: invalid-argument on kernel (auto&) const::'lambda'(auto)> - #0 in sycl::_V1::event sycl::_V1::queue::submit_with_event>>(sycl::_V1::ext::oneapi::experimental::properties>, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:3762:12 - #1 in std::enable_if, sycl::_V1::event>::type sycl::_V1::queue::submit(auto, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:429:12 - #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:106:7 - #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5bd8f) - #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5be3f) - #5 in _start (./1_matrix_mul_invalid_contexts_asan+0x403624) - - The 5th argument 0x7fddcf88a800 is allocated in other context - 0x7fddcf88a800 is located inside of Device USM region [0x7fddcf88a800, 0x7fddcf8e2640) + #0 in sycl::_V1::event sycl::_V1::queue::submit_with_event>>(sycl::_V1::ext::oneapi::experimental::properties>, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:3700:12 + #1 in std::enable_if, sycl::_V1::event>::type sycl::_V1::queue::submit(auto, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:441:12 + #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:126:7 + #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x70114642a1c9) + #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x70114642a28a) + #5 in _start (./1_matrix_mul_invalid_contexts_asan+0x403674) + + The 5th argument 0xff00ffffffe70800 is allocated in other device + 0xff00ffffffe70800 is located inside of Device USM region [0xff00ffffffe70800, 0xff00ffffffec8640) allocated here: - #0 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::device const&, sycl::_V1::context const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/usm.hpp:174:27 - #1 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::queue const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/usm.hpp:182:10 - #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:82:21 - #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5bd8f) - #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x7fddd2a5be3f) - #5 in _start (./1_matrix_mul_invalid_contexts_asan+0x403624) + #0 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::device const&, sycl::_V1::context const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/usm.hpp:175:27 + #1 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::queue const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/usm.hpp:183:10 + #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:102:21 + #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x70114642a1c9) + #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x70114642a28a) + #5 in _start (./1_matrix_mul_invalid_contexts_asan+0x403674) Aborted (core dumped) ``` @@ -271,42 +269,44 @@ A recent addition to the oneAPI compiler is that ability to use the "Address San 3. Look at the reported source location - That Address Sanitizer threw an error at line 106 where we enter the main work kernel. + That Address Sanitizer threw an error at line 126 where we enter the main work kernel. ``` - 99 q.submit([&](auto &h) { - 100 h.memcpy(dev_c, &c_back[0], M*P * sizeof(float)); - 101 }); - 102 - 103 q.wait(); - 104 - 105 // Submit command group to queue to multiply matrices: c = a * b - 106 q.submit([&](auto &h) { // Something reported wrong here - 107 // Read from a and b, write to c - 108 int width_a = N; - 109 - 110 // Execute kernel. + 119 q.submit([&](auto &h) { + 120 h.memcpy(dev_c, &c_back[0], M*P * sizeof(float)); + 121 }); + 122 + 123 q.wait(); + 124 + 125 // Submit command group to queue to multiply matrices: c = a * b + 126 q.submit([&](auto &h) { + 127 // Read from a and b, write to c + 128 int width_a = N; + 129 + 130 // Execute kernel. ``` - And it complained that "the 5th argument" was allocated in another context, an element that was set up in line 82: + And it complained that "the 5th argument" was allocated in another context, an element that was set up in line 102: ``` - 77 float * dev_a = sycl::malloc_device(M*N, q); - 78 float * dev_b = sycl::malloc_device(N*P, q); - 79 device selected_device = device(default_selector_v); - 80 context devicecontext(selected_device); - 81 queue q2(devicecontext, selected_device); - 82 float * dev_c = sycl::malloc_device(M*P, q2); // Complaining about this - 83 - 84 cout << "Problem size: c(" << M << "," << P << ") = a(" << M << "," << N - 85 << ") * b(" << N << "," << P << ")\n"; + 93 float * dev_a = sycl::malloc_device(M*N, q); + 94 float * dev_b = sycl::malloc_device(N*P, q); + 95 #ifdef BAD_FREE + 96 device selected_device = devices[0]; + 97 #else + 98 device selected_device = devices[1]; + 99 #endif + 100 context devicecontext(selected_device); + 101 queue q2(devicecontext, selected_device); + 102 float * dev_c = sycl::malloc_device(M*P, q2); + 103 ``` - Unfortunately, figuring out which "5th argument" of which kernel is involved requires internal knowledge of Level Zero API calls and how SYCL collects the references used in the `q.submit` lambda function at line 106. We can get some of this by running `unitrace ` against `./1_matrix_mul_invalid_contexts_asan`, but the result is not satisfying. + Unfortunately, figuring out which "5th argument" of which kernel is involved requires internal knowledge of Level Zero API calls and how SYCL collects the references used in the `q.submit` lambda function at line 126. We can get some of this by running `unitrace ` against `./1_matrix_mul_invalid_contexts_asan`, but the result is not satisfying. - Also, it may not be useful to figure out which argument was involved, because this may not be where things first go bad. The SYCL syntax used in this program means that `q.submit` statements will immediately return control to the calling program even if the submitted kernel is still running. So the problem might have occurred before line 106, and we are only just now learning about it. + Also, it may not be useful to figure out which argument was involved, because this may not be where things first go bad. The SYCL syntax used in this program means that `q.submit` statements will immediately return control to the calling program even if the submitted kernel is still running. So the problem might have occurred before line 126, and we are only just now learning about it. - However, we don't need to go that deep into the internals. We are told that the invalid element encountered at line 106 was allocated to a different context in line 82. Here we see that `dev_c` is the variable, and it was allocated a size of `M*P` using queue `q2`. + However, we don't need to go that deep into the internals. We are told that the invalid element encountered at line 126 was allocated to a different device context in line 102. Here we see that `dev_c` is the variable, and it was allocated a size of `M*P` using queue `q2`. You've probably spotted the problem in this trivial example, but let's use the debugger to see if we can gather additional information to do a proper diagnosis. @@ -375,22 +375,21 @@ In case we need view code running on the GPU, we need to enable GPU debugging. #7 0x00007ffff78a5a55 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x00007ffff78bb0c1 in std::rethrow_exception(std::__exception_ptr::exception_ptr) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - #9 0x00007ffff7ec9ef3 in sycl::_V1::detail::Scheduler::enqueueCommandForCG(std::shared_ptr, std::vector >&, sycl::_V1::detail::BlockingT) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #10 0x00007ffff7ec9695 in sycl::_V1::detail::Scheduler::addCG(std::unique_ptr >, std::shared_ptr const&, bool, ur_exp_command_buffer_handle_t_*, std::vector > const&) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #11 0x00007ffff7efe432 in sycl::_V1::handler::finalize() () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #12 0x00007ffff7e84277 in void sycl::_V1::detail::queue_impl::finalizeHandler(sycl::_V1::handler&, sycl::_V1::event&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #13 0x00007ffff7e832b7 in sycl::_V1::detail::queue_impl::submit_impl(std::function const&, std::shared_ptr const&, std::shared_ptr const&, std::shared_ptr const&, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::SubmissionInfo const&) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #14 0x00007ffff7e895c8 in sycl::_V1::detail::queue_impl::submit_with_event(std::function const&, std::shared_ptr const&, sycl::_V1::detail::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #15 0x00007ffff7f33afa in sycl::_V1::queue::submit_with_event_impl(std::function, sycl::_V1::detail::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) () - from /opt/intel/oneapi/compiler/2025.1/lib/libsycl.so.8 - #16 0x00000000004049a3 in sycl::_V1::queue::submit_with_event(main::{lambda(auto:1&)#1}, sycl::_V1::queue*, sycl::_V1::detail::code_location const&) (this=0x7fffffffb778, CGF=..., SecondaryQueuePtr=0x0, - CodeLoc=...) at /opt/intel/oneapi/compiler/2025.1/bin/compiler/../../include/sycl/queue.hpp:2826 - #17 0x00000000004043bd in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb778, CGF=..., CodeLoc=...) - at /opt/intel/oneapi/compiler/2025.1/bin/compiler/../../include/sycl/queue.hpp:365 - #18 0x0000000000403f7b in main () - at 1_matrix_mul_invalid_contexts.cpp:99 - + #9 0x00007ffff7ee0f48 in sycl::_V1::detail::Scheduler::enqueueCommandForCG(sycl::_V1::detail::event_impl&, std::vector >&, sycl::_V1::detail::BlockingT) () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #10 0x00007ffff7edff90 in sycl::_V1::detail::Scheduler::addCG(std::unique_ptr >, sycl::_V1::detail::queue_impl&, bool, ur_exp_command_buffer_handle_t_*, std::vector > const&) () from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #11 0x00007ffff7f10267 in sycl::_V1::handler::finalize() () from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #12 0x00007ffff7e93a38 in std::shared_ptr sycl::_V1::detail::queue_impl::finalizeHandlerOutOfOrder(sycl::_V1::handler&) () from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #13 0x00007ffff7e92e04 in sycl::_V1::detail::queue_impl::submit_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::_V1::SubmissionInfo const&) () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #14 0x00007ffff7f58ac9 in sycl::_V1::queue::submit_with_event_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::_V1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) const () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #15 0x0000000000407b4e in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb598, Props=..., CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:3700 + #16 0x00000000004048e1 in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb598, CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:441 + #17 0x00000000004043e8 in main () + at Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp:119 (gdb) ``` @@ -400,15 +399,15 @@ In case we need view code running on the GPU, we need to enable GPU debugging. 6. Switch the debugger focus to that frame. ``` - (gdb) frame 18 + (gdb) frame 17 ``` Your output will be similar to the following: ``` - #18 0x0000000000403f7b in main () - at Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp:99 - 99 q.submit([&](auto &h) { + #17 0x00000000004043e8 in main () + at Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp:119 + 119 q.submit([&](auto &h) { (gdb) ``` @@ -421,27 +420,27 @@ In case we need view code running on the GPU, we need to enable GPU debugging. You should see the code around the line reporting the problem. ``` - 94 - 95 // Submit command group to queue to initialize matrix b - 96 q.memcpy(dev_b, &b_back[0], N*P * sizeof(float)); - 97 - 98 // Submit command group to queue to initialize matrix c - 99 q.submit([&](auto &h) { - 100 h.memcpy(dev_c, &c_back[0], M*P * sizeof(float)); - 101 }); - 102 - 103 q.wait(); + 114 + 115 // Submit command group to queue to initialize matrix b + 116 q.memcpy(dev_b, &b_back[0], N*P * sizeof(float)); + 117 + 118 // Submit command group to queue to initialize matrix c + 119 q.submit([&](auto &h) { + 120 h.memcpy(dev_c, &c_back[0], M*P * sizeof(float)); + 121 }); + 122 + 123 q.wait(); ``` - Something wrong in line 99. Unfortunately, the + Something wrong in line 119. Unfortunately, the ` Enqueue process failed` message we saw when it crashed does not really tell us anything other than our attempt to submit the `memcpy` to the device failed - Fortunately, in this case the two variables, `dev_c` and `c_back`, are allocated only a few lines above line 99. In real code this might have happened in another source file or library, so hunting down this issue is going to be much harder. + Fortunately, in this case the two variables, `dev_c` and `c_back`, are allocated only a few lines above line 102. In real code this might have happened in another source file or library, so hunting down this issue is going to be much harder. Look at the source, and note that `dev_c` is defined as a pointer to device memory allocated on queue `q2` (we noticed this with Address Sanitizer): ``` - 82 float * dev_c = sycl::malloc_device(M*P, q2); + 102 float * dev_c = sycl::malloc_device(M*P, q2); ``` and `c_back` is defined as local memory @@ -450,15 +449,15 @@ In case we need view code running on the GPU, we need to enable GPU debugging. 49 float(*c_back)[P] = new float[M][P]; ``` -8. Look at line 99, and notice the discrepancy. +8. Look at line 119, and notice the discrepancy. ``` - 99 q.submit([&](auto &h) { + 119 q.submit([&](auto &h) { ``` - Variable `dev_c` was allocated on queue `q2` while the submit statement is being done on queue `q`. These queues are created using deferent devices contexts (the default one, and `devicecontext`) + Variable `dev_c` was allocated on queue `q2` while the submit statement is being done on queue `q`. These queues are created using different devices contexts (the default one, and `devicecontext`). - So unlike what Address Sanitizer suggested, the problem was first noticed in line 99, not 106. The debugger stopped immediately, while Address Sanitizer took a moment longer to spot the problem/respond to the exception. + So unlike what Address Sanitizer suggested, the problem was first noticed in line 119, not 126. The debugger stopped immediately, while Address Sanitizer took a moment longer to spot the problem/respond to the exception. ### Identify the Problem without Code Inspection @@ -472,20 +471,20 @@ is every low-level API call made to OpenCL™ or Level Zero. We will use it to a to enable call logging of API calls. > **Note**: You must modify the command shown below to include the path to - > where you installed the `unitrace` utility. + > where you installed the `unitrace` utility. We also recommend that you redirect the results to a file so that you can look at them in an editor via ` > results.txt 2>&1` ``` ONEAPI_DEVICE_SELECTOR=opencl:gpu [path]/unitrace -c --opencl ./1_matrix_mul_invalid_contexts ``` - The `unitrace` utility outputs extensive results, which will look similiar to the below. A few key excerpts with areas of interest are shown below (note - pulling these out is not easy without a program that can highlight multiple searches with different colors). + The `unitrace` utility outputs extensive results, which will look similar to the below. A few key excerpts with areas of interest are shown below (note - pulling these out is not easy without a program that can highlight multiple searches with different colors). ![alt text](./TraceOutput.png "unitrace -c output for OpenCL") - Let's work backwards from the error, starting with `clEnqueueMemcpyINTEL` (which corresponds to the `q.submit` at line 99 in the source). + Let's work backwards from the error, starting with `clEnqueueMemcpyINTEL` (which corresponds to the `q.submit` at line 119 in the source). The final `clEnqueueMemcpyINTEL` (line 22) uses `command_queue = 0x49d7130` and copies - `src_ptr` into device memory `dst_ptr = 0xff00ffffffeb0000` (NOTE: in some versions of `unitrace` these addresses may be returned in decimal rather than hexidecimal). Working back + `src_ptr` into device memory `dst_ptr = 0xff00ffffffeb0000` (NOTE: in some versions of `unitrace` these addresses may be returned in decimal rather than hexadecimal). Working back up the trace, you can see we allocated the destination device memory with the address `0xff00ffffffeb0000` using context `0x49dbff0` (line 16). However, the command queue (`0x49d7130`) being used in the `clEnqueueMemcpyINTEL` call @@ -497,19 +496,18 @@ is every low-level API call made to OpenCL™ or Level Zero. We will use it to a This *is legal* if both queues point to the same device context; however, in this example `q2` is actually defined pointing to another device context. You might do this in actual code if you have multiple offload compute - devices you are targeting. This code is sending work and data to each - device for processing. It is easy to accidentally send the wrong pointer to - the wrong queue in complex code. + devices you are targeting. It is easy to accidentally send the wrong pointer to + the wrong queue or device in complex code (as in this case). For comparison, an example of legal memory copy where the device context (`0x488d190`) used for the command queue (`0x49d7130`) is the same as that used for the memory allocation is shown as well (lines 4, 7, 19). -2. Let's also look at the output from Level Zero, and see if we could have +2. Let's also look at the output from Level Zero (the default GPU runtime), and see if we could have detected the issue there: ``` - ONEAPI_DEVICE_SELECTOR=level_zero:gpu [path]unitrace -c ./1_matrix_mul_invalid_contexts + [path]unitrace -c ./1_matrix_mul_invalid_contexts ``` Your output might be similar to the following: @@ -531,8 +529,10 @@ is every low-level API call made to OpenCL™ or Level Zero. We will use it to a timeline showing "what happened when" using the Chrome(tm) tracing browser tool. -### A final thought. -If you look at the source, `1_matrix_mul_invalid_contexts.cpp`, you will see that both queues where created with the `default_selector_v` device selector to make this tutorial work for most people (lines 66 and 79). If these were set to use different device selectors (say `gpu_selector_v` and `cpu_selector_v` or a custom device), or we specified exactly which device to use for each queue, our ability to use `ONEAPI_DEVICE_SELECTOR` to explore the problem might have been handicapped in this sample. But we hope it is clear that this code has an error in it in the case where two entirely different devices are selected. +### Cautionary thought. +Throughout this sample we made use of `ONEAPI_DEVICE_SELECTOR` to explore this problem. If it worked for you, it was because we were lucky - there were multiple instances of the same device, so we were able to explicitly create SYCL queues on two different devices of the same type. If not, we still we hope it is clear that this code has an error in it in the case where two entirely different devices are selected. + +If the above example did not work for you, we hope that you will try the bonus example below which shows another bug arising from using the wrong device context. For more on device discovery in SYCL, please see https://www.intel.com/content/www/us/en/developer/articles/technical/device-discovery-with-sycl.html. @@ -540,11 +540,184 @@ For more on device discovery in SYCL, please see https://www.intel.com/content/w To fix this problem, you must change the `malloc_device` allocating `dev_c` to use the same queue (and thus same device context) as the first two device -allocations or create queue `q` to use the same underlying device context. +allocations or create queue `q2` in such a way that it uses the same underlying device context. -If you really need to operate over multiple devices, this example will need to +If you really need to operate over multiple devices, exchanging data between devices, this example will need to be entirely re-written, which is beyond the scope of this tutorial. +### Bonus example + +1. Build some new binaries from our demo program: + ``` + icpx -fsycl -O0 -g -std=gnu++17 -Rno-debug-disables-optimization -D BAD_FREE -o 1_matrix_mul_invalid_contexts_badfree ../src/1_matrix_mul_invalid_contexts.cpp + + icpx -fsycl -O0 -g -Xarch_device -fsanitize=address -std=gnu++17 -Rno-debug-disables-optimization -D BAD_FREE -o 1_matrix_mul_invalid_contexts_asan_badfree ../src/1_matrix_mul_invalid_contexts.cpp + ``` + +2. If you run `1_matrix_mul_invalid_contexts_asan_badfree`, it should run without errors. + +3. Recall that SYCL applications use the Level Zero runtime by default with an Intel GPU. But what happens if you use OpenCL™ runtime to run 1_matrix_mul_invalid_contexts on the GPU? + + ``` + ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_invalid_contexts_badfree + ``` + The output might look similar to the following: + ``` + ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_invalid_contexts_badfree + Initializing + Devices: + [0] Intel(R) Data Center GPU Max 1100, OpenCL 3.0 NEO [25.18.33578] 3.0, Intel(R) Corporation + Computing + Device: Intel(R) Data Center GPU Max 1100 + Device compute units: 448 + Device max work item size: 1024, 1024, 1024 + Device max work group size: 1024 + Problem size: c(150,600) = a(150,300) * b(300,600) + terminate called after throwing an instance of 'sycl::_V1::exception' + what(): Enqueue process failed. + opencl backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + Aborted (core dumped) + ``` + > **Note**: you will only see the above if the sycl-ls command shows OpenCL devices for the graphics card. If you are missing [opencl:gpu] devices you may have to add the necessary libraries to your device path by setting the appropriate path in DRIVERLOC and then running the following four commands (for Ubuntu - adapt for other OSes): + ``` + export DRIVERLOC=/usr/lib/x86_64-linux-gnu + export OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES:$DRIVERLOC/intel-opencl/libigdrcl.so + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DRIVERLOC + export PATH=$PATH:/opt/intel/oneapi:$DRIVERLOC + ``` + Then issue the `ONEAPI_DEVICE_SELECTOR=opencl:gpu ./1_matrix_mul_invalid_contexts_badfree` command again to see the above error. + +4. However, if you run 1_matrix_mul_invalid_contexts_asan_badfree, you will see the following: + + ``` + ./1_matrix_mul_invalid_contexts_asan_badfree + Initializing + ==== DeviceSanitizer: ASAN + Devices: + [0] Intel(R) Data Center GPU Max 1100, 12.60.7 [1.6.33578+51] 1.6.33578+51, Intel(R) Corporation + [1] Intel(R) Xeon(R) Platinum 8480+, OpenCL 3.0 (Build 0) [2026.21.3.0.31_160000] 3.0, Intel(R) Corporation + [2] Intel(R) Xeon(R) Platinum 8480+, OpenCL 3.0 (Build 0) [2023.16.7.0.21_160000] 3.0, Intel(R) Corporation + Computing + Device: Intel(R) Data Center GPU Max 1100 + Device compute units: 448 + Device max work item size: 1024, 1024, 1024 + Device max work group size: 1024 + Problem size: c(150,600) = a(150,300) * b(300,600) + + ====ERROR: DeviceSanitizer: bad-context on address 0xff00ffffffe80800 + #0 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:157:5 + #1 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x795381e2a1c9) + #2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x795381e2a28a) + #3 in _start (./1_matrix_mul_invalid_contexts_asan_badfree+0x403674) + + 0xff00ffffffe80800 is located inside of Device USM region [0xff00ffffffe80800, 0xff00ffffffed8640) + allocated here: + #0 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::device const&, sycl::_V1::context const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/usm.hpp:175:27 + #1 in float* sycl::_V1::malloc_device(unsigned long, sycl::_V1::queue const&, sycl::_V1::property_list const&, sycl::_V1::detail::code_location const&) /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/usm.hpp:183:10 + #2 in main Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/build/../src/1_matrix_mul_invalid_contexts.cpp:102:21 + #3 in ?? (/lib/x86_64-linux-gnu/libc.so.6+0x795381e2a1c9) + #4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x795381e2a28a) + #5 in _start (./1_matrix_mul_invalid_contexts_asan_badfree+0x403674) + + Aborted (core dumped) + ``` + +5. Line 157 says this: + + ``` + 157 sycl::free(dev_c, q); + ``` + And here is where the memory was allocated: + ``` + 100 context devicecontext(selected_device); + 101 queue q2(devicecontext, selected_device); + 102 float * dev_c = sycl::malloc_device(M*P, q2); + ``` + As is hopefully obvious from the previous example, the problem is that we are trying to free memory allocated in SYCL queue `q2` that has a different device context fron SYCL queue `q`, even though under the covers they point to the same hardware device. + +6. While we are at it, what does the debugger show us? + ``` + ONEAPI_DEVICE_SELECTOR=opencl:gpu ZET_ENABLE_PROGRAM_DEBUGGING=1 gdb-oneapi ./1_matrix_mul_invalid_contexts_badfree + ``` + And then + ``` + (gdb) run + ``` + We crash like before: + ``` + Initializing + Devices: + [0] Intel(R) Data Center GPU Max 1100, OpenCL 3.0 NEO [25.18.33578] 3.0, Intel(R) Corporation + Computing + Device: Intel(R) Data Center GPU Max 1100 + Device compute units: 448 + Device max work item size: 1024, 1024, 1024 + Device max work group size: 1024 + Problem size: c(150,600) = a(150,300) * b(300,600) + [New Thread 0x7fffcae006c0 (LWP 2084018)] + terminate called after throwing an instance of 'sycl::_V1::exception' + what(): Enqueue process failed. + opencl backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + + Thread 1 "1_matrix_mul_in" received signal SIGABRT, Aborted. + __pthread_kill_implementation (no_tid=0, signo=6, threadid=) at ./nptl/pthread_kill.c:44 + ⚠️ warning: 44 ./nptl/pthread_kill.c: No such file or directory + ``` +7. Looking at the backtrace + ``` + (gdb) backtrace + #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=) at ./nptl/pthread_kill.c:44 + #1 __pthread_kill_internal (signo=6, threadid=) at ./nptl/pthread_kill.c:78 + #2 __GI___pthread_kill (threadid=, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 + #3 0x00007ffff764527e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 + #4 0x00007ffff76288ff in __GI_abort () at ./stdlib/abort.c:79 + #5 0x00007ffff7ca5ff5 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 + #6 0x00007ffff7cbb0da in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 + #7 0x00007ffff7ca5a55 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 + #8 0x00007ffff7cbb0c1 in std::rethrow_exception(std::__exception_ptr::exception_ptr) () + from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 + #9 0x00007ffff7b23f48 in sycl::_V1::detail::Scheduler::enqueueCommandForCG(sycl::_V1::detail::event_impl&, std::vector >&, sycl::_V1::detail::BlockingT) () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #10 0x00007ffff7b22f90 in sycl::_V1::detail::Scheduler::addCG(std::unique_ptr >, sycl::_V1::detail::queue_impl&, bool, ur_exp_command_buffer_handle_t_*, std::vector > const&) () from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #11 0x00007ffff7b53267 in sycl::_V1::handler::finalize() () from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #12 0x00007ffff7ad6a38 in std::shared_ptr sycl::_V1::detail::queue_impl::finalizeHandlerOutOfOrder(sycl::_V1::handler&) () from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #13 0x00007ffff7ad5e04 in sycl::_V1::detail::queue_impl::submit_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, bool, sycl::_V1::detail::code_location const&, bool, sycl::_V1::detail::_V1::SubmissionInfo const&) () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #14 0x00007ffff7b9bac9 in sycl::_V1::queue::submit_with_event_impl(sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::_V1::SubmissionInfo const&, sycl::_V1::detail::code_location const&, bool) const () + from /opt/intel/oneapi/compiler/2026.0/lib/libsycl.so.9 + #15 0x0000000000407b3e in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb588, Props=..., CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:3700 + #16 0x00000000004048d1 in sycl::_V1::queue::submit(main::{lambda(auto:1&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb588, CGF=..., CodeLoc=...) + at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:441 + #17 0x00000000004043de in main () at ../src/1_matrix_mul_invalid_contexts.cpp:119 + (gdb) + ``` + + We are back to the error above. Recall that line line 119 is doing this: + + ``` + 119 q.submit([&](auto &h) { + 120 h.memcpy(dev_c, &c_back[0], M*P * sizeof(float)); + 121 }); + ``` + + Variable `dev_c` was allocated on queue `q2` while the submit statement is being done on queue `q`. These queues are created using different devices contexts. Now, they point to the same device, but the device context is different. + + Interestingly, Address Sanitizer was fine with that. What it objected to (running under Level Zero rather than OpenCL here) was trying to free memory allocated in one SYCL device context in a different SYCL device context. + + Even more interestingly, if you run this program in the debugger under level zero like so: + ``` + ONEAPI_DEVICE_SELECTOR=level_zero:gpu ZET_ENABLE_PROGRAM_DEBUGGING=1 gdb-oneapi ./1_matrix_mul_invalid_contexts_badfree + ``` + The program will complete without errors. + + Both of these tools are correct that there is an error here. Level Zero gave the impression (including in the debugger) that everything was fine, while Address Sanitizer caught the bad free in Level Zero. Unfortunately Address Sanitizer does not run under OpenCL. Still, OpenCL itself helped identify the other issue (using queues belonging to different contexts interchangeably) because, unlike Level Zero, it does not allow this. + +### Final Thoughts +Both of these examples are cases of subtle coding errors that might work well in some environments, but not in others. When SYCL queues and devices start getting passed around between functions, or libraries, along with memory allocated using those queues, it can be easy to lose track of which queue owns a given buffer, and subtle errors can start to creep in. + +Moral of the story: check your program from time-time on different GPU runtimes (Level Zero and OpenCL), and with different tools, in the hopes of exposing these issues before they come too deeply imbedded and hard to track down. + ## License Code samples are licensed under the MIT license. See diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp index dc505e0c2f..9810af1bbd 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/1_matrix_mul_invalid_contexts.cpp @@ -63,7 +63,23 @@ int main() { // Initialize the device queue with the default selector. The device queue is // used to enqueue kernels. It encapsulates all states needed for execution. { - queue q(default_selector_v); + property_list propList = property_list{property::queue::enable_profiling()}; + + std::vector devices = sycl::device::get_devices(); + cout << "Devices:" << std::endl; + + for (size_t index = 0; index < devices.size(); index++){ + std::string device_name = devices[index].get_info(); + std::string device_driver = devices[index].get_info(); + std::string sycl_version = devices[index].get_info(); + std::string vendor = devices[index].get_info(); + std::string backend = devices[index].get_info(); + std::cout << " [" << index << "] " << device_name << ", " << sycl_version << " [" << device_driver + << "] " << backend << ", " << vendor << std::endl; + } + + // Be very specific about the device to use. + queue q(devices[0]); cout << "Computing" << "\n"; cout << "Device: " << q.get_device().get_info() << "\n"; @@ -76,7 +92,11 @@ int main() { // Create 2D buffers for matrices, buffer c is bound with host memory c_back float * dev_a = sycl::malloc_device(M*N, q); float * dev_b = sycl::malloc_device(N*P, q); - device selected_device = device(default_selector_v); +#ifdef BAD_FREE + device selected_device = devices[0]; +#else + device selected_device = devices[1]; +#endif context devicecontext(selected_device); queue q2(devicecontext, selected_device); float * dev_c = sycl::malloc_device(M*P, q2); @@ -131,6 +151,13 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + sycl::free(dev_a, q); + sycl::free(dev_b, q); +#ifdef BAD_FREE + sycl::free(dev_c, q); +#else + sycl::free(dev_c, q2); +#endif } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/2_matrix_mul.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/2_matrix_mul.cpp index ac97b65b23..0883604faa 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/2_matrix_mul.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_InvalidContexts/src/2_matrix_mul.cpp @@ -65,6 +65,19 @@ int main() { { property_list propList = property_list{property::queue::enable_profiling()}; + std::vector devices = sycl::device::get_devices(); + cout << "Devices:" << std::endl; + + for (size_t index = 0; index < devices.size(); index++){ + std::string device_name = devices[index].get_info(); + std::string device_driver = devices[index].get_info(); + std::string sycl_version = devices[index].get_info(); + std::string vendor = devices[index].get_info(); + std::string backend = devices[index].get_info(); + std::cout << " [" << index << "] " << device_name << ", " << sycl_version << " [" << device_driver + << "] " << backend << ", " << vendor << std::endl; + } + queue q(default_selector_v); cout << "Computing" << "\n"; @@ -130,6 +143,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md index 2bce82e253..5583300434 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_RaceCondition/README.md @@ -1,6 +1,6 @@ # `Guided Matrix Multiplication Race Condition` Sample -The `Guided Matrix Multiplication Race Condition` sample demonstrates a guided approach to debugging a race condition accessing data on the host before it has been fully copied back from the device. It uses the Intel® oneAPI Base Toolkit (Base Kit) and several tools included in the Base Kit. +The `Guided Matrix Multiplication Race Condition` sample demonstrates an approach to debugging a race condition using several tools in Intel® oneAPI. The race condition arises from accessing data on the host before it has been fully copied back from the device. The sample is a simple program that multiplies together two large matrices and verifies the results. @@ -22,7 +22,7 @@ The sample includes different versions of a simple matrix multiplication program | File name | Description |:--- |:--- | `1_matrix_mul_race_condition.cpp` |This example shows what happens when a developer tries to access data provided by the device before the copy to the host is complete. -| `2_matrix_mul.cpp` | A working version of the matrix multiply code that properly waits for the data to be copied back to the host. +| `2_matrix_mul.cpp` | A working version of the matrix multiply code that properly waits for the data to be copied back to the host but still has some issues. | `3_matrix_mul.cpp` | A working version of the application that corrects its errors using a host accessor and a `q.wait` command in place of parenthesis. ## Prerequisites @@ -30,9 +30,9 @@ The sample includes different versions of a simple matrix multiplication program | Optimized for | Description |:--- |:--- | OS | Ubuntu* 24.04 LTS -| Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html +| Intel GraphicsHardware | GEN9 or newer +| Software | Intel® oneAPI DPC++/C++ Compiler 2026.0
Intel® Distribution for GDB* 2026.0
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.59 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -44,7 +44,7 @@ The basic SYCL* standards implemented in the code include the use of the followi ## Set Environment Variables -When working with the command-line interface (CLI), you should configure the oneAPI toolkits using environment variables. Set up your CLI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries, and tools are ready for development. +When working with the command-line interface (CLI), set up your oneAPI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development. ## Build and Run the `Guided Matrix Multiply Race Condition` Programs @@ -115,8 +115,6 @@ the `VERBOSE=1` argument: make VERBOSE=1 ``` -If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the *[Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html)* for more information on using the utility. - ## Guided Debugging @@ -125,7 +123,7 @@ This example shows what happens when code tries to access data provided by the d These instructions assume you have installed the Intel® Distribution for GDB* and have a basic working knowledge of GDB. ### Setting up to Debug on the GPU -To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GDB-PVC debugger](https://dgpu-docs.intel.com/system-user-guides/DNP-Max-1100-userguide/DNP-Max-1100-userguide.html#gdb-pvc-debugger)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. +To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GPU Debugging](https://dgpu-docs.intel.com/driver/gpu-debugging.html)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. Documentation on using the debugger in a variety of situations can be found at *[Debug Examples in Linux](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/current/overview.html)* @@ -133,13 +131,13 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with Intel® oneAPI. To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). ### Examine the Original Code -As you might have noticed, when you attempt to run `1_matrix_mul_race_condition.cpp` the code reports bad results and then exits. We can use the Intel® Distribution for GDB* to get a backtrace of the entire stack to understand the problem. +As you might have noticed, when you attempt to run `1_matrix_mul_race_condition` the code reports bad results and then exits. We can use the Intel® Distribution for GDB* to get a backtrace of the entire stack to understand the problem. In case we need view code running on the GPU, we need to enable GPU debugging. This will require [some setup on your system](#setting-up-to-debug-on-the-gpu) before you can see code running on the GPU. @@ -149,7 +147,7 @@ In case we need view code running on the GPU, we need to enable GPU debugging. ``` 2. Then run the application in the debugger. ``` - run + (gdb) run ``` 3. Examine the results. ``` @@ -276,13 +274,22 @@ In case we need view code running on the GPU, we need to enable GPU debugging. Fail - The result is incorrect for element: [0, 3], expected: 45150, but found: 0 Fail - The result is incorrect for element: [0, 4], expected: 45150, but found: 0 Fail - The results mismatch! - >>>> [211022976795378] zeEventCreate: hEventPool = 37983040 desc = 140734297023408 {ZE_STRUCTURE_TYPE_EVENT_DESC(0x11) 0 4 4 0} phEvent = 140734297023464 (hEvent = 15669694584003) - <<<< [211022976802066] zeEventCreate [1339 ns] hEvent = 37883384 -> ZE_RESULT_SUCCESS(0x0) - >>>> [211022976805342] zeCommandListAppendMemoryCopyRegion: hCommandList = 37277672 dstptr = 35936816 dstRegion = 140734297023744 dstPitch = 2400 dstSlicePitch = 360000 srcptr = 18374967954634571776 srcRegion = 140734297023768 srcPitch = 2400 srcSlicePitch = 360000 hSignalEvent = 37883384 numWaitEvents = 1 phWaitEvents = 37993232 (hWaitEvents = [37882840]) - <<<< [211022976856153] zeCommandListAppendMemoryCopyRegion [46127 ns] hWaitEvents = 37882840 -> ZE_RESULT_SUCCESS(0x0) - >>>> [211022976862571] zeEventHostSynchronize: hEvent = 37883384 timeout = 18446744073709551615 - <<<< [211022979801501] zeEventHostSynchronize [2937354 ns] -> ZE_RESULT_SUCCESS(0x0) - Segmentation fault (core dumped) + >>>> [670752705693142] zeEventCreate: hEventPool = 0x48187f8 desc = 0x7ffea023b540 {ZE_STRUCTURE_TYPE_EVENT_DESC(0x11) 0 4 4 0} phEvent = 0x7ffea023b578 (hEvent = 0x0) + <<<< [670752705701414] zeEventCreate [2045 ns] hEvent = 0x4935aa8 -> ZE_RESULT_SUCCESS(0x0) + >>>> [670752705704779] zeCommandListAppendMemoryCopyRegion: hCommandList = 0x4917708 dstptr = 0x5b103e38010 dstRegion = 0x7ffea023b740 dstPitch = 0x960 dstSlicePitch = 0x57e40 srcptr = 0xff00ffffff2e0000 srcRegion = 0x7ffea023b768 srcPitch = 0x960 srcSlicePitch = 0x57e40 hSignalEvent = 0x4935aa8 numWaitEvents = 0x1 phWaitEvents = 0x4935390 (hWaitEvents = [0x49353d8]) + <<<< [670752705716520] zeCommandListAppendMemoryCopyRegion [7285 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) + >>>> [670752705801127] zeEventQueryStatus: hEvent = 0x49353d8 + <<<< [670752705806038] zeEventQueryStatus [2103 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [670752705809927] zeEventHostSynchronize: hEvent = 0x49353d8 timeout = 0xffffffffffffffff + <<<< [670752706994834] zeEventHostSynchronize [1182409 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [670752707005758] zeEventQueryStatus: hEvent = 0x4935aa8 + <<<< [670752707010312] zeEventQueryStatus [1742 ns] -> ZE_RESULT_NOT_READY(0x1) + >>>> [670752707014922] zeEventQueryStatus: hEvent = 0x4935aa8 + <<<< [670752707018218] zeEventQueryStatus [1273 ns] -> ZE_RESULT_NOT_READY(0x1) + >>>> [670752707038683] zeEventQueryStatus: hEvent = 0x4935aa8 + <<<< [670752707042673] zeEventQueryStatus [1348 ns] -> ZE_RESULT_NOT_READY(0x1) + >>>> [670752707045585] zeEventQueryStatus: hEvent = 0x4935aa8 + <<<< [670752707048684] zeEventQueryStatus [1206 ns] -> ZE_RESULT_NOT_READY(0x1) ``` ### Interpret the Results @@ -291,7 +298,7 @@ The first clue here is that the program throws an exception *after* it has compl Next, looking at the crash in the debugger, there are a couple of odd things that stand out. Look at stack `frame 9`. This frame shows us attempting to update the host memory from the device, while `frame 20` shows we are already at the end of the program and have started cleaning up the SYCL buffers (`frame 19`). The only variable containing data returned from the device is `c_back`. But the developer has already deleted `c_back` in line 126, so the *data the buffer being copied into (`c_back`) no longer exists*. -We see something like this in the `unitrace` output above. The kernel is executed, the results are immediately checked, we create and wait on some events, and then the last thing we try to do before crashing is to copy some memory from the device memory (`srcptr = 18374967954634571776`) to a host pointer (`dstptr = 35936816`) that previously was used to initialize this same device memory (around line 101). Since `c_buf` is the only accessor that is defined as writeable in the `q.submit` at line 97, it again is a likely suspect. +We see something like this in the `unitrace` output above. The kernel is executed, the results are immediately checked, we create and wait on some events, and then the last thing we try to do before crashing/timing out is to copy some memory from the device memory (`srcptr = 0xff00ffffff2e0000`) to a host pointer (`dstptr = 0x5b103e38010`) that previously was used to initialize this same device memory (around line 101). Since `c_buf` is the only accessor that is defined as writeable in the `q.submit` at line 97, it again is a likely suspect. But what if the developer didn't delete `c_back`, and let program termination clean it up? Try it! diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md index 79e5dc4c03..c86dbdbbf0 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md +++ b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/README.md @@ -1,6 +1,6 @@ # `Guided Matrix Multiplication Illegal SLM Size` Sample -The `Guided Matrix Multiplication Illegal SLM Size` sample demonstrates a guided approach to debugging incorrect use of the SYCL language. The sample uses the Intel® oneAPI Base Toolkit (Base Kit) and several tools included in the Base Kit. +The `Guided Matrix Multiplication Illegal SLM Size` sample demonstrates an approach to debugging incorrect use of the SYCL language using several tools in Intel® oneAPI. The sample is a simple program that multiplies together two large matrices and verifies the results. @@ -30,9 +30,9 @@ The sample includes different versions of a simple matrix multiplication program | Optimized for | Description |:--- |:--- | OS | Ubuntu* 24.04 LTS -| Hardware | GEN9 or newer -| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3
Intel® Distribution for GDB* 2025.3
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). -| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html +| Intel Graphics Hardware | GEN9 or newer +| Software | Intel® oneAPI DPC++/C++ Compiler 2026.0
Intel® Distribution for GDB* 2026.0
Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace). +| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.59 or later from https://dgpu-docs.intel.com/releases/releases.html ## Key Implementation Details @@ -49,7 +49,7 @@ This can be particularly painful. For example, you might experience this error i ## Set Environment Variables -When working with the command-line interface (CLI), you should configure the oneAPI toolkits using environment variables. Set up your CLI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries, and tools are ready for development. +When working with the command-line interface (CLI), set up your oneAPI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development. ## Build and Run the `Guided Matrix Multiplication Illegal SLM Size` Sample @@ -117,15 +117,13 @@ the `VERBOSE=1` argument: make VERBOSE=1 ``` -If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the *[Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html)* for more information on using the utility. - ## Guided Debugging These instructions assume you have installed the Intel® Distribution for GDB* and have a basic working knowledge of GDB. ### Setting up to Debug on the GPU -To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GDB-PVC debugger](https://dgpu-docs.intel.com/system-user-guides/DNP-Max-1100-userguide/DNP-Max-1100-userguide.html#gdb-pvc-debugger)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. +To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GPU Debugging](https://dgpu-docs.intel.com/driver/gpu-debugging.html)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*. Documentation on using the debugger in a variety of situations can be found at *[Debug Examples in Linux](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/current/overview.html)* @@ -134,7 +132,7 @@ Documentation on using the debugger in a variety of situations can be found at * ### Getting the Tracing and Profiling Tool -In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit). +In this tutorial, the instructions require a utility that was not installed with Intel® oneAPI. To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB). @@ -180,11 +178,14 @@ In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illeg The application will fail and display the same message when we ran it outside of the debugger. ``` : - Problem size: c(150,600) = a(150,300) * b(300,600) + Continuing with GPU-debugging disabled. + terminate called after throwing an instance of 'sycl::_V1::exception' - what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) + what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Thread 1.1 "1_matrix_mul_SL" received signal SIGABRT, Aborted. + __pthread_kill_implementation (no_tid=0, signo=6, threadid=) at ./nptl/pthread_kill.c:44 + ⚠️ warning: 44 ./nptl/pthread_kill.c: No such file or directory (gdb) ``` @@ -210,18 +211,17 @@ In `1_matrix_mul_SLM_size`, the local_accessor class is used to reserve an illeg #10 0x00007ffff7de164a in sycl::_V1::detail::enqueue_kernel_launch::handleErrorOrWarning(ur_result_t, sycl::_V1::detail::device_impl const&, ur_kernel_handle_t_*, sycl::_V1::detail::NDRDescT const&) () from /opt/intel/oneapi/compiler/2025.3/lib/libsycl.so.8 : - #19 0x0000000000407e62 in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb580, Props=..., CGF=..., CodeLoc=...) - at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:3762 - #20 0x00000000004043e9 in sycl::_V1::queue::submit(main::{lambda(sycl::_V1::handler&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb580, CGF=..., CodeLoc=...) - at /opt/intel/oneapi/compiler/2025.3/bin/compiler/../../include/sycl/queue.hpp:429 - #21 0x0000000000403fa3 in main () + #18 0x0000000000407d5e in sycl::_V1::queue::submit_with_event > >(sycl::_V1::ext::oneapi::experimental::properties >, sycl::_V1::detail::type_erased_cgfo_ty const&, sycl::_V1::detail::code_location const&) const (this=0x7fffffffb680, Props=..., CGF=..., + CodeLoc=...) at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:3700 + #19 0x0000000000404419 in sycl::_V1::queue::submit(main::{lambda(sycl::_V1::handler&)#1}, sycl::_V1::detail::code_location const&) (this=0x7fffffffb680, CGF=..., CodeLoc=...) at /opt/intel/oneapi/compiler/2026.0/bin/compiler/../../include/sycl/queue.hpp:441 + #20 0x0000000000403f73 in main () at Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 ``` 4. Look at the final frame. (Your frame number might differ, and you might have to repeat this command to get the frame to change). ``` - (gdb) frame 21 - #21 0x0000000000403fe3 in main () at Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 + (gdb) frame 20 + #20 0x0000000000403fe3 in main () at Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp:104 104 q.submit([&](handler &h){ (gdb) ``` @@ -264,14 +264,14 @@ Among other things, the Tracing and Profiling utility can print every low-level 3. Let the output continue until the error occurs and the program stops. ``` : - >>>> [806881439215102] zeKernelSetGroupSize: hKernel = 0x2a54be8 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 - <<<< [806881439220367] zeKernelSetGroupSize [1631 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [806881439225163] zeCommandListCreateImmediate: hContext = 0x29cd578 hDevice = 0x2936ee8 altdesc = 0x7ffcce631850 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 0x7ffcce631838 (hCommandList = 0x0) - <<<< [806881439391714] zeCommandListCreateImmediate [160772 ns] hCommandList = 0x2d3b218 -> ZE_RESULT_SUCCESS(0x0) - >>>> [806881439399881] zeEventHostReset: hEvent = 0x2cd8a88 - <<<< [806881439403570] zeEventHostReset [1577 ns] -> ZE_RESULT_SUCCESS(0x0) - >>>> [806881439411094] zeCommandListAppendLaunchKernel: hCommandList = 0x2d3b218 hKernel = 0x2a54be8 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7ffcce631d78 {16385, 1, 1} hSignalEvent = 0x2cd8a88 numWaitEvents = 0x0 phWaitEvents = 0x0 - <<<< [806881439467224] zeCommandListAppendLaunchKernel [47029 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) + >>>> [672116802394124] zeKernelSetGroupSize: hKernel = 0x2689658 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 + <<<< [672116802398592] zeKernelSetGroupSize [1577 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [672116802403366] zeCommandListCreateImmediate: hContext = 0x260be58 hDevice = 0x25752c8 altdesc = 0x7fffb216c300 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 0x7fffb216c2e8 (hCommandList = 0x0) + <<<< [672116802564843] zeCommandListCreateImmediate [156721 ns] hCommandList = 0x3d56268 -> ZE_RESULT_SUCCESS(0x0) + >>>> [672116802577317] zeEventHostReset: hEvent = 0x3b585a8 + <<<< [672116802581433] zeEventHostReset [1546 ns] -> ZE_RESULT_SUCCESS(0x0) + >>>> [672116802588167] zeCommandListAppendLaunchKernel: hCommandList = 0x3d56268 hKernel = 0x2689658 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7fffb216c840 {16385, 1, 1} hSignalEvent = 0x3b585a8 numWaitEvents = 0x0 phWaitEvents = 0x0 + <<<< [672116802646429] zeCommandListAppendLaunchKernel [49631 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) terminate called after throwing an instance of 'sycl::_V1::exception' what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Aborted (core dumped) @@ -282,12 +282,12 @@ Among other things, the Tracing and Profiling utility can print every low-level A note about the output above. You will see that is has two lines that read: ``` - >>>> [806881439215102] zeKernelSetGroupSize: hKernel = 0x2a54be8 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 + >>>> [672116802394124] zeKernelSetGroupSize: hKernel = 0x2689658 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 : - >>>> [806881439411094] zeCommandListAppendLaunchKernel: hCommandList = 0x2d3b218 hKernel = 0x2a54be8 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7ffcce631d78 {16385, 1, 1} hSignalEvent = 0x2cd8a88 numWaitEvents = 0x0 phWaitEvents = 0x0 + >>>> [672116802588167] zeCommandListAppendLaunchKernel: hCommandList = 0x3d56268 hKernel = 0x2689658 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7fffb216c840 {16385, 1, 1} hSignalEvent = 0x3b585a8 numWaitEvents = 0x0 phWaitEvents = 0x0 ``` - We used the form of `parallel_for` that takes the `nd_range`, which specifies the global iteration range (163850) and the local work-group size (10) like so: `nd_range<1>{{163850}, {10}}`. The first line above shows the workgroup size (`groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1`), and the second shows how many total workgroups will be needed to process the global iteration range (`{16385, 1, 1}`). + At like 106 we used the form of `parallel_for` that takes the `nd_range`, which specifies the global iteration range (163850) and the local work-group size (10) like so: `nd_range<1>{{163850}, {10}}`. The first line above shows the workgroup size (`groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1`), and the second shows how many total workgroups will be needed to process the global iteration range (`{16385, 1, 1}`). ### Determine Device Limits @@ -322,21 +322,21 @@ If the `parallel_for` were operating over a multi-dimensional range (for example You should know that different devices will have different amounts of memory set aside as SLM. In SYCL, you can query this number by passing `info::device::local_mem_size` to the `get_info` member of the `device` class. -Finally, running under `unitrace -c` you see: +Finally, running under `unitrace -c` with these debug variables set you will see: ``` : ->>>> [807184674868230] zeKernelSetGroupSize: hKernel = 0x257bbe8 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 -<<<< [807184674879934] zeKernelSetGroupSize [1560 ns] -> ZE_RESULT_SUCCESS(0x0) ->>>> [807184674884930] zeCommandListCreateImmediate: hContext = 0x24f4578 hDevice = 0x245e2f8 altdesc = 0x7ffeb187b880 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 0x7ffeb187b868 (hCommandList = 0x0) +>>>> [672514990780902] zeKernelSetGroupSize: hKernel = 0x3fa2658 groupSizeX = 0xa groupSizeY = 0x1 groupSizeZ = 0x1 +<<<< [672514990785597] zeKernelSetGroupSize [1532 ns] -> ZE_RESULT_SUCCESS(0x0) +>>>> [672514990790934] zeCommandListCreateImmediate: hContext = 0x3f24e58 hDevice = 0x3e8e6d8 altdesc = 0x7fff875129a0 {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC(0xe) 0 0 0 0 2 0} phCommandList = 0x7fff87512988 (hCommandList = 0x0) Flush Task for Immediate command list : Enabled -Using PCI barrier ptr: 0xbbbf8206000 -<<<< [807184675059549] zeCommandListCreateImmediate [169347 ns] hCommandList = 0x2862218 -> ZE_RESULT_SUCCESS(0x0) ->>>> [807184675067615] zeEventHostReset: hEvent = 0x27ffa88 -<<<< [807184675071317] zeEventHostReset [1401 ns] -> ZE_RESULT_SUCCESS(0x0) ->>>> [807184675077771] zeCommandListAppendLaunchKernel: hCommandList = 0x2862218 hKernel = 0x257bbe8 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7ffeb187bda8 {16385, 1, 1} hSignalEvent = 0x27ffa88 numWaitEvents = 0x0 phWaitEvents = 0x0 +Using PCI barrier ptr: 0xc615206b000 +<<<< [672514990965418] zeCommandListCreateImmediate [169631 ns] hCommandList = 0x566f268 -> ZE_RESULT_SUCCESS(0x0) +>>>> [672514990977437] zeEventHostReset: hEvent = 0x54715a8 +<<<< [672514990981535] zeEventHostReset [1392 ns] -> ZE_RESULT_SUCCESS(0x0) +>>>> [672514990988038] zeCommandListAppendLaunchKernel: hCommandList = 0x566f268 hKernel = 0x3fa2658 (_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlNS0_7nd_itemILi1EEEE_) pLaunchFuncArgs = 0x7fff87512ee0 {16385, 1, 1} hSignalEvent = 0x54715a8 numWaitEvents = 0x0 phWaitEvents = 0x0 Size of SLM (656384) larger than available (131072) -<<<< [807184675135249] zeCommandListAppendLaunchKernel [48600 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) +<<<< [672514991042897] zeCommandListAppendLaunchKernel [46307 ns] -> ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY(0x1879048195) terminate called after throwing an instance of 'sycl::_V1::exception' what(): level_zero backend failed with error: 40 (UR_RESULT_ERROR_OUT_OF_RESOURCES) Aborted (core dumped) diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp index ae77a0ebfe..0d506b8e23 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/1_matrix_mul_SLM_size.cpp @@ -138,6 +138,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result; diff --git a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/2_matrix_mul.cpp b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/2_matrix_mul.cpp index 8f79f07e70..8138f2fd46 100644 --- a/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/2_matrix_mul.cpp +++ b/Tools/ApplicationDebugger/guided_matrix_mult_SLMSize/src/2_matrix_mul.cpp @@ -130,6 +130,10 @@ int main() { q.memcpy(&c_back[0], dev_c, M*P * sizeof(float)); q.wait(); + + sycl::free(dev_a, q); + sycl::free(dev_b, q); + sycl::free(dev_c, q); } int result;