mkl_dfti_omp_offload.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*******************************************************************************
  2. * Copyright 2019-2022 Intel Corporation.
  3. *
  4. * This software and the related documents are Intel copyrighted materials, and
  5. * your use of them is governed by the express license under which they were
  6. * provided to you (License). Unless the License provides otherwise, you may not
  7. * use, modify, copy, publish, distribute, disclose or transmit this software or
  8. * the related documents without Intel's prior written permission.
  9. *
  10. * This software and the related documents are provided as is, with no express
  11. * or implied warranties, other than those that are expressly stated in the
  12. * License.
  13. *******************************************************************************/
  14. /*
  15. ! Content:
  16. ! Intel(R) oneAPI Math Kernel Library (oneMKL)
  17. ! Discrete Fourier Transform Interface (DFTI) for OpenMP target (offload)
  18. !******************************************************************************/
  19. #ifndef MKL_DFTI_OMP_OFFLOAD_H_INCLUDED
  20. #define MKL_DFTI_OMP_OFFLOAD_H_INCLUDED
  21. #include "mkl_dfti.h"
  22. #include "mkl_service.h"
  23. #if (_OPENMP >= 202011)
  24. #include <omp.h>
  25. #endif
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif // __cplusplus
  29. DFTI_EXTERN MKL_LONG mkl_DftiCommitDescriptor_omp_offload(DFTI_DESCRIPTOR_HANDLE,
  30. void *interop_obj);
  31. #if (_OPENMP >= 202011)
  32. #pragma omp declare variant(mkl_DftiCommitDescriptor_omp_offload) \
  33. match(construct={dispatch}, device={arch(gen)}) \
  34. append_args(interop(prefer_type("sycl","level_zero"),targetsync))
  35. #endif
  36. #pragma omp declare variant(mkl_DftiCommitDescriptor_omp_offload) \
  37. match(construct = {target variant dispatch}, device = {arch(gen)})
  38. DFTI_EXTERN MKL_LONG DftiCommitDescriptor(DFTI_DESCRIPTOR_HANDLE);
  39. DFTI_EXTERN MKL_LONG mkl_DftiComputeForward_omp_offload(DFTI_DESCRIPTOR_HANDLE,
  40. void *p1,
  41. void *interop_obj, ...);
  42. #if (_OPENMP >= 202011)
  43. #pragma omp declare variant(mkl_DftiComputeForward_omp_offload) \
  44. match(construct={dispatch}, device={arch(gen)}) \
  45. append_args(interop(prefer_type("sycl","level_zero"),targetsync)) \
  46. adjust_args(need_device_ptr:p1)
  47. #endif
  48. #pragma omp declare variant(mkl_DftiComputeForward_omp_offload) \
  49. match(construct = {target variant dispatch}, device = {arch(gen)})
  50. DFTI_EXTERN MKL_LONG DftiComputeForward(DFTI_DESCRIPTOR_HANDLE,
  51. void *p1, ...);
  52. DFTI_EXTERN MKL_LONG mkl_DftiComputeBackward_omp_offload(DFTI_DESCRIPTOR_HANDLE,
  53. void *p1,
  54. void *interop_obj, ...);
  55. #if (_OPENMP >= 202011)
  56. #pragma omp declare variant(mkl_DftiComputeBackward_omp_offload) \
  57. match(construct={dispatch}, device={arch(gen)}) \
  58. append_args(interop(prefer_type("sycl","level_zero"),targetsync)) \
  59. adjust_args(need_device_ptr:p1)
  60. #endif
  61. #pragma omp declare variant(mkl_DftiComputeBackward_omp_offload) \
  62. match(construct = {target variant dispatch}, device = {arch(gen)})
  63. DFTI_EXTERN MKL_LONG DftiComputeBackward(DFTI_DESCRIPTOR_HANDLE,
  64. void *p1, ...);
  65. #ifdef __cplusplus
  66. }
  67. #endif // __cplusplus
  68. #endif // MKL_DFTI_OMP_OFFLOAD_H_INCLUDED