Skip to content

Commit

Permalink
[SYCLomatic] Update the include file for oneMKL since it has renamed …
Browse files Browse the repository at this point in the history
…to oneMath (#2575)


Signed-off-by: Jiang, Zhiwei <[email protected]>
  • Loading branch information
zhiweij1 authored Jan 6, 2025
1 parent eb7646a commit 49dd16b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
3 changes: 0 additions & 3 deletions clang/lib/DPCT/AnalysisInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,9 +984,6 @@ void DpctFileInfo::insertHeader(HeaderType Type, unsigned Offset,
insertHeader(HT_DPL_Execution);
insertHeader(HT_DPL_Algorithm);
break;
case HT_MKL_RNG:
insertHeader(HT_MKL_Mkl);
break;
case HT_DPCT_CodePin_CUDA:
case HT_DPCT_CodePin_SYCL: {
OS << getNL();
Expand Down
3 changes: 0 additions & 3 deletions clang/lib/DPCT/RulesInclude/HeaderTypes.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ ONEDPL_HEADER(Async, "<oneapi/dpl/async>")
ONEDPL_HEADER(Memory, "<oneapi/dpl/memory>")
ONEDPL_HEADER(Random, "<oneapi/dpl/random>")

MKL_HEADER(Mkl, "<oneapi/mkl.hpp>")
MKL_HEADER(RNG, "<oneapi/mkl/rng/device.hpp>")

DPCT_HEADER(Dpct, "<dpct/dpct.hpp>")
DPCT_HEADER(DPL_Utils, "<dpct/dpl_utils.hpp>")
DPCT_HEADER(FFT_Utils, "<dpct/fft_utils.hpp>")
Expand Down
9 changes: 9 additions & 0 deletions clang/runtime/dpct-rt/include/dpct/dnnl_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@

#include <oneapi/dnnl/dnnl.hpp>
#include <oneapi/dnnl/dnnl_sycl.hpp>

#if defined(__has_include) && __has_include(<oneapi/math/rng/device.hpp>)
#include <oneapi/math/rng/device.hpp>
#elif defined(__has_include) && __has_include(<oneapi/mkl/rng/device.hpp>)
#include <oneapi/mkl/rng/device.hpp>
#elif defined(__has_include)
#error "SYCLomatic runtime requires oneMath/oneMKL support"
#else
#error "SYCLomatic runtime requires __has_include support"
#endif

#include <algorithm>
#include <list>
Expand Down
9 changes: 9 additions & 0 deletions clang/runtime/dpct-rt/include/dpct/lib_common_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@

#include "compat_service.hpp"

#if defined(__has_include) && __has_include(<oneapi/math.hpp>)
#include <oneapi/math.hpp>
#include <oneapi/mkl/namespace_alias.hpp>
#elif defined(__has_include) && __has_include(<oneapi/mkl.hpp>)
#include <oneapi/mkl.hpp>
#elif defined(__has_include)
#error "SYCLomatic runtime requires oneMath/oneMKL support"
#else
#error "SYCLomatic runtime requires __has_include support"
#endif

namespace dpct {

Expand Down
8 changes: 8 additions & 0 deletions clang/runtime/dpct-rt/include/dpct/rng_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
#include "compat_service.hpp"
#include "lib_common_utils.hpp"

#if defined(__has_include) && __has_include(<oneapi/math/rng/device.hpp>)
#include <oneapi/math/rng/device.hpp>
#elif defined(__has_include) && __has_include(<oneapi/mkl/rng/device.hpp>)
#include <oneapi/mkl/rng/device.hpp>
#elif defined(__has_include)
#error "SYCLomatic runtime requires oneMath/oneMKL support"
#else
#error "SYCLomatic runtime requires __has_include support"
#endif

namespace dpct::rng {
enum class random_mode {
Expand Down

0 comments on commit 49dd16b

Please sign in to comment.