|
| 1 | +//===--- dppl_sycl_enum_types.h - DPPL-SYCL interface ---*---C++ -----*----===// |
| 2 | +// |
| 3 | +// Python Data Parallel Processing Library (PyDPPL) |
| 4 | +// |
| 5 | +// Copyright 2020 Intel Corporation |
| 6 | +// |
| 7 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +// you may not use this file except in compliance with the License. |
| 9 | +// You may obtain a copy of the License at |
| 10 | +// |
| 11 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +// |
| 13 | +// Unless required by applicable law or agreed to in writing, software |
| 14 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +// See the License for the specific language governing permissions and |
| 17 | +// limitations under the License. |
| 18 | +// |
| 19 | +//===----------------------------------------------------------------------===// |
| 20 | +/// |
| 21 | +/// \file |
| 22 | +/// This header defines DPPL specficif enum types that wrap corresponding Sycl |
| 23 | +/// enum classes. These enums are defined primarily so that Python extensions |
| 24 | +/// that use DPPL do not have to include Sycl headers directly. |
| 25 | +/// |
| 26 | +//===----------------------------------------------------------------------===// |
| 27 | + |
| 28 | +#pragma once |
| 29 | + |
| 30 | +#include "Support/ExternC.h" |
| 31 | + |
| 32 | +DPPL_C_EXTERN_C_BEGIN |
| 33 | + |
| 34 | +/*! |
| 35 | + * @brief Redefinition of DPC++-specific Sycl backend types. |
| 36 | + * |
| 37 | + */ |
| 38 | +enum DPPLSyclBackendType |
| 39 | +{ |
| 40 | + DPPL_UNKNOWN_BACKEND = 0x0, |
| 41 | + DPPL_OPENCL = 1 << 16, |
| 42 | + DPPL_HOST = 1 << 15, |
| 43 | + DPPL_LEVEL_ZERO = 1 << 14, |
| 44 | + DPPL_CUDA = 1 << 13 |
| 45 | +}; |
| 46 | + |
| 47 | +/*! |
| 48 | + * @brief DPPL device types that are equivalent to Sycl's device_type. |
| 49 | + * |
| 50 | + */ |
| 51 | +enum DPPLSyclDeviceType |
| 52 | +{ |
| 53 | + DPPL_CPU = 1 << 0, |
| 54 | + DPPL_GPU = 1 << 1, |
| 55 | + DPPL_ACCELERATOR = 1 << 2, |
| 56 | + DPPL_CUSTOM = 1 << 3, |
| 57 | + DPPL_AUTOMATIC = 1 << 4, |
| 58 | + DPPL_HOST_DEVICE = 1 << 5, |
| 59 | + DPPL_ALL = 1 << 6 |
| 60 | + // IMP: before adding new values here look at DPPLSyclBackendType enum. The |
| 61 | + // values should not overlap. |
| 62 | +}; |
| 63 | + |
| 64 | +/*! |
| 65 | + * @brief Supported types for kernel arguments to be passed to a Sycl kernel |
| 66 | + * using DPPL. |
| 67 | + * |
| 68 | + * \todo Add support for sycl::buffer |
| 69 | + * |
| 70 | + */ |
| 71 | +typedef enum |
| 72 | +{ |
| 73 | + DPPL_CHAR, |
| 74 | + DPPL_SIGNED_CHAR, |
| 75 | + DPPL_UNSIGNED_CHAR, |
| 76 | + DPPL_SHORT, |
| 77 | + DPPL_INT, |
| 78 | + DPPL_UNSIGNED_INT, |
| 79 | + DPPL_LONG, |
| 80 | + DPPL_UNSIGNED_LONG, |
| 81 | + DPPL_LONG_LONG, |
| 82 | + DPPL_UNSIGNED_LONG_LONG, |
| 83 | + DPPL_SIZE_T, |
| 84 | + DPPL_FLOAT, |
| 85 | + DPPL_DOUBLE, |
| 86 | + DPPL_LONG_DOUBLE, |
| 87 | + DPPL_VOID_PTR |
| 88 | +} DPPLKernelArgType; |
| 89 | + |
| 90 | +DPPL_C_EXTERN_C_END |
0 commit comments