Initial commit.
This commit is contained in:
commit
d3bb49b3f5
1073 changed files with 484757 additions and 0 deletions
53
Framework/external/embree/tutorials/common/device_default.h
vendored
Normal file
53
Framework/external/embree/tutorials/common/device_default.h
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// Copyright 2009-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(EMBREE_SYCL_SUPPORT)
|
||||
// If we use the internal clang frontend of the dpc++ compiler directly __INTEL_LLVM_COMPILER is not set.
|
||||
// I think doing this is fine because normal clang can not compile dpcpp/sycl code anyway.
|
||||
#if defined(__WIN32__) and defined(__clang__) and !defined(__INTEL_LLVM_COMPILER)
|
||||
#define __INTEL_LLVM_COMPILER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(EMBREE_SYCL_TUTORIAL)
|
||||
# define __SYCL_USE_NON_VARIADIC_SPIRV_OCL_PRINTF__
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
# pragma clang diagnostic ignored "-W#pragma-messages"
|
||||
# include <sycl/sycl.hpp>
|
||||
# pragma clang diagnostic pop
|
||||
#else
|
||||
# if !defined(SYCL_EXTERNAL)
|
||||
# define SYCL_EXTERNAL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* include embree API */
|
||||
#include "../../include/embree4/rtcore.h"
|
||||
RTC_NAMESPACE_USE
|
||||
#include "../../kernels/config.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
#if defined(EMBREE_SYCL_TUTORIAL) && defined(EMBREE_SYCL_SUPPORT)
|
||||
|
||||
extern sycl::queue *global_gpu_queue;
|
||||
extern sycl::context *global_gpu_context;
|
||||
extern sycl::device *global_gpu_device;
|
||||
|
||||
/* returns function pointer to be usable in SYCL kernel */
|
||||
template<auto F>
|
||||
inline decltype(F) getFunctionPointer() {
|
||||
return rtcGetSYCLDeviceFunctionPointer<F>(*global_gpu_queue);
|
||||
}
|
||||
#define GET_FUNCTION_POINTER(f) getFunctionPointer<f>()
|
||||
|
||||
#else
|
||||
|
||||
#define GET_FUNCTION_POINTER(f) f
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue