DPC++ Runtime
Runtime libraries for oneAPI DPC++
platform_util.hpp
Go to the documentation of this file.
1 //===--------- platform_util.hpp - platform utilities ----------*- C++ -*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
12 #include <cstdint>
13 
14 #ifdef _MSC_VER
15 // This feature is not supported in MSVC.
16 #define __builtin_expect(a, b) (a)
17 #endif
18 
20 namespace sycl {
21 namespace detail {
22 
23 struct PlatformUtil {
24  enum class TypeIndex : unsigned int {
25  Char = 0,
26  Short = 1,
27  Int = 2,
28  Long = 3,
29  Float = 4,
30  Double = 5,
31  Half = 6
32  };
33 
35  static uint32_t getNativeVectorWidth(TypeIndex Index);
36 
37  static uint32_t getMaxClockFrequency();
38 
39  static uint32_t getMemCacheLineSize();
40 
41  static uint64_t getMemCacheSize();
42 
43  static void prefetch(const char *Ptr, size_t NumBytes);
44 };
45 
46 } // namespace detail
47 } // namespace sycl
48 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::detail::PlatformUtil
Definition: platform_util.hpp:23
sycl
Definition: invoke_simd.hpp:68
cl::sycl::detail::PlatformUtil::TypeIndex
TypeIndex
Definition: platform_util.hpp:24
defines.hpp
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12