mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Enable building OpenCL-CTS with Intel DPC++/C++ compiler ICX on Windows (#2088)
Currently Intel® C++ Compiler Classic (ICC) is supported to build OpenCL-CTS on Windows. This compiler has been discontinued since the second half of 2023. Instead, Intel recommends that users transition to use the LLVM-based Intel® oneAPI DPC++/C++ Compiler (ICX). This change is to enable users to build OpenCL-CTS with ICX on Windows.
This commit is contained in:
@@ -152,8 +152,14 @@ if(MSVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" )
|
if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" )
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source")
|
set(Shared_Flags_Intel "-Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -fp:strict")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Shared_Flags_Intel}")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Shared_Flags_Intel}")
|
||||||
|
if (NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM"))
|
||||||
|
set(ICC_Extra_Flags "-Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:source")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ICC_Extra_Flags}")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ICC_Extra_Flags}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# To handle addresses larger than 2 gigabytes for 32bit targets
|
# To handle addresses larger than 2 gigabytes for 32bit targets
|
||||||
|
|||||||
@@ -714,6 +714,11 @@ int32_t float2int(float fx)
|
|||||||
return u.i;
|
return u.i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __has_builtin
|
||||||
|
#define __has_builtin(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !__has_builtin(__builtin_clz)
|
||||||
#if !defined(_WIN64)
|
#if !defined(_WIN64)
|
||||||
/** Returns the number of leading 0-bits in x,
|
/** Returns the number of leading 0-bits in x,
|
||||||
starting at the most significant bit position.
|
starting at the most significant bit position.
|
||||||
@@ -778,6 +783,7 @@ int __builtin_clz(unsigned int pattern)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined(_WIN64)
|
#endif // !defined(_WIN64)
|
||||||
|
#endif // !__has_builtin(__builtin_clz)
|
||||||
|
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
|
|||||||
@@ -28,18 +28,6 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// CL error checking.
|
// CL error checking.
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#define CL_EXIT_ERROR(cmd, ...) \
|
|
||||||
{ \
|
|
||||||
if ((cmd) != CL_SUCCESS) \
|
|
||||||
{ \
|
|
||||||
log_error("CL ERROR: %s %u: ", __FILE__, __LINE__); \
|
|
||||||
log_error(##__VA_ARGS__); \
|
|
||||||
log_error("\n"); \
|
|
||||||
return -1; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define CL_EXIT_ERROR(cmd, format, ...) \
|
#define CL_EXIT_ERROR(cmd, format, ...) \
|
||||||
{ \
|
{ \
|
||||||
if ((cmd) != CL_SUCCESS) \
|
if ((cmd) != CL_SUCCESS) \
|
||||||
@@ -50,7 +38,6 @@
|
|||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CL_EXIT_BUILD_ERROR(cmd, program, format, ...) \
|
#define CL_EXIT_BUILD_ERROR(cmd, program, format, ...) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ int context_create(cl_device_id deviceID, cl_context context,
|
|||||||
CResult result;
|
CResult result;
|
||||||
|
|
||||||
// create device
|
// create device
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
result.ResultSub(CResult::TEST_ERROR);
|
result.ResultSub(CResult::TEST_ERROR);
|
||||||
@@ -68,7 +68,7 @@ int context_create(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectSharedHandle = 0;
|
void *objectSharedHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surface;
|
std::unique_ptr<CSurfaceWrapper> surface;
|
||||||
if (!MediaSurfaceCreate(
|
if (!MediaSurfaceCreate(
|
||||||
adapterType, width, height, surfaceFormat, *deviceWrapper,
|
adapterType, width, height, surfaceFormat, *deviceWrapper,
|
||||||
surface, (sharedHandle == SHARED_HANDLE_ENABLED) ? true : false,
|
surface, (sharedHandle == SHARED_HANDLE_ENABLED) ? true : false,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ int api_functions(cl_device_id deviceID, cl_context context,
|
|||||||
CResult result;
|
CResult result;
|
||||||
|
|
||||||
// create device
|
// create device
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
result.ResultSub(CResult::TEST_ERROR);
|
result.ResultSub(CResult::TEST_ERROR);
|
||||||
@@ -87,7 +87,7 @@ int api_functions(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectSharedHandle = 0;
|
void *objectSharedHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surface;
|
std::unique_ptr<CSurfaceWrapper> surface;
|
||||||
|
|
||||||
// create surface
|
// create surface
|
||||||
if (!MediaSurfaceCreate(
|
if (!MediaSurfaceCreate(
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ int kernel_functions(cl_device_id deviceID, cl_context context,
|
|||||||
|
|
||||||
CResult result;
|
CResult result;
|
||||||
|
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
result.ResultSub(CResult::TEST_ERROR);
|
result.ResultSub(CResult::TEST_ERROR);
|
||||||
@@ -102,7 +102,7 @@ int kernel_functions(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectSrcHandle = 0;
|
void *objectSrcHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surfaceSrc;
|
std::unique_ptr<CSurfaceWrapper> surfaceSrc;
|
||||||
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
||||||
*deviceWrapper, surfaceSrc,
|
*deviceWrapper, surfaceSrc,
|
||||||
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
||||||
@@ -116,7 +116,7 @@ int kernel_functions(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectDstHandle = 0;
|
void *objectDstHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surfaceDst;
|
std::unique_ptr<CSurfaceWrapper> surfaceDst;
|
||||||
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
||||||
*deviceWrapper, surfaceDst,
|
*deviceWrapper, surfaceDst,
|
||||||
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ int get_device_ids(cl_device_id deviceID, cl_context context,
|
|||||||
{
|
{
|
||||||
CResult result;
|
CResult result;
|
||||||
|
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
result.ResultSub(CResult::TEST_ERROR);
|
result.ResultSub(CResult::TEST_ERROR);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ int interop_user_sync(cl_device_id deviceID, cl_context context,
|
|||||||
CResult result;
|
CResult result;
|
||||||
|
|
||||||
// create device
|
// create device
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
result.ResultSub(CResult::TEST_ERROR);
|
result.ResultSub(CResult::TEST_ERROR);
|
||||||
@@ -72,7 +72,7 @@ int interop_user_sync(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectSharedHandle = 0;
|
void *objectSharedHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surface;
|
std::unique_ptr<CSurfaceWrapper> surface;
|
||||||
if (!MediaSurfaceCreate(
|
if (!MediaSurfaceCreate(
|
||||||
adapterType, width, height, surfaceFormat, *deviceWrapper,
|
adapterType, width, height, surfaceFormat, *deviceWrapper,
|
||||||
surface, (sharedHandle == SHARED_HANDLE_ENABLED) ? true : false,
|
surface, (sharedHandle == SHARED_HANDLE_ENABLED) ? true : false,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ int memory_access(cl_device_id deviceID, cl_context context,
|
|||||||
{
|
{
|
||||||
CResult result;
|
CResult result;
|
||||||
|
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
// creates device
|
// creates device
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
@@ -74,7 +74,7 @@ int memory_access(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectSharedHandle = 0;
|
void *objectSharedHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surface;
|
std::unique_ptr<CSurfaceWrapper> surface;
|
||||||
|
|
||||||
// creates surface
|
// creates surface
|
||||||
if (!MediaSurfaceCreate(
|
if (!MediaSurfaceCreate(
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ int other_data_types(cl_device_id deviceID, cl_context context,
|
|||||||
return result.Result();
|
return result.Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::auto_ptr<CDeviceWrapper> deviceWrapper;
|
std::unique_ptr<CDeviceWrapper> deviceWrapper;
|
||||||
if (!DeviceCreate(adapterType, deviceWrapper))
|
if (!DeviceCreate(adapterType, deviceWrapper))
|
||||||
{
|
{
|
||||||
result.ResultSub(CResult::TEST_ERROR);
|
result.ResultSub(CResult::TEST_ERROR);
|
||||||
@@ -158,7 +158,7 @@ int other_data_types(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectSrcHandle = 0;
|
void *objectSrcHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surfaceSrc;
|
std::unique_ptr<CSurfaceWrapper> surfaceSrc;
|
||||||
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
||||||
*deviceWrapper, surfaceSrc,
|
*deviceWrapper, surfaceSrc,
|
||||||
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
||||||
@@ -172,7 +172,7 @@ int other_data_types(cl_device_id deviceID, cl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *objectDstHandle = 0;
|
void *objectDstHandle = 0;
|
||||||
std::auto_ptr<CSurfaceWrapper> surfaceDst;
|
std::unique_ptr<CSurfaceWrapper> surfaceDst;
|
||||||
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
if (!MediaSurfaceCreate(adapterType, width, height, surfaceFormat,
|
||||||
*deviceWrapper, surfaceDst,
|
*deviceWrapper, surfaceDst,
|
||||||
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
(sharedHandle == SHARED_HANDLE_ENABLED) ? true
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ bool YUVGenerate(TSurfaceFormat surfaceFormat, std::vector<cl_uchar> &yuv,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool YUVSurfaceSetNV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceSetNV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
const std::vector<cl_uchar> &yuv, unsigned int width,
|
const std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -257,7 +257,7 @@ bool YUVSurfaceSetNV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool YUVSurfaceSetYV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceSetYV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
const std::vector<cl_uchar> &yuv, unsigned int width,
|
const std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -305,7 +305,7 @@ bool YUVSurfaceSetYV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool YUVSurfaceSet(TSurfaceFormat surfaceFormat,
|
bool YUVSurfaceSet(TSurfaceFormat surfaceFormat,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
const std::vector<cl_uchar> &yuv, unsigned int width,
|
const std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -326,7 +326,7 @@ bool YUVSurfaceSet(TSurfaceFormat surfaceFormat,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool YUVSurfaceGetNV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceGetNV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
std::vector<cl_uchar> &yuv, unsigned int width,
|
std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -363,7 +363,7 @@ bool YUVSurfaceGetNV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool YUVSurfaceGetYV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceGetYV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
std::vector<cl_uchar> &yuv, unsigned int width,
|
std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -411,7 +411,7 @@ bool YUVSurfaceGetYV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool YUVSurfaceGet(TSurfaceFormat surfaceFormat,
|
bool YUVSurfaceGet(TSurfaceFormat surfaceFormat,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
std::vector<cl_uchar> &yuv, unsigned int width,
|
std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
@@ -1078,7 +1078,7 @@ bool GetImageInfo(cl_mem object, cl_image_format formatExp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GetMemObjInfo(cl_mem object, cl_dx9_media_adapter_type_khr adapterType,
|
bool GetMemObjInfo(cl_mem object, cl_dx9_media_adapter_type_khr adapterType,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
void *shareHandleExp)
|
void *shareHandleExp)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
@@ -1172,7 +1172,7 @@ bool GetMemObjInfo(cl_mem object, cl_dx9_media_adapter_type_khr adapterType,
|
|||||||
bool ImageInfoVerify(cl_dx9_media_adapter_type_khr adapterType,
|
bool ImageInfoVerify(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
const std::vector<cl_mem> &memObjList, unsigned int width,
|
const std::vector<cl_mem> &memObjList, unsigned int width,
|
||||||
unsigned int height,
|
unsigned int height,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
void *sharedHandle)
|
void *sharedHandle)
|
||||||
{
|
{
|
||||||
if (memObjList.size() != 2 && memObjList.size() != 3)
|
if (memObjList.size() != 2 && memObjList.size() != 3)
|
||||||
@@ -1379,19 +1379,19 @@ D3DFORMAT SurfaceFormatToD3D(TSurfaceFormat surfaceFormat)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool DeviceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
bool DeviceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
std::auto_ptr<CDeviceWrapper> &device)
|
std::unique_ptr<CDeviceWrapper> &device)
|
||||||
{
|
{
|
||||||
switch (adapterType)
|
switch (adapterType)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
case CL_ADAPTER_D3D9_KHR:
|
case CL_ADAPTER_D3D9_KHR:
|
||||||
device = std::auto_ptr<CDeviceWrapper>(new CD3D9Wrapper());
|
device = std::unique_ptr<CDeviceWrapper>(new CD3D9Wrapper());
|
||||||
break;
|
break;
|
||||||
case CL_ADAPTER_D3D9EX_KHR:
|
case CL_ADAPTER_D3D9EX_KHR:
|
||||||
device = std::auto_ptr<CDeviceWrapper>(new CD3D9ExWrapper());
|
device = std::unique_ptr<CDeviceWrapper>(new CD3D9ExWrapper());
|
||||||
break;
|
break;
|
||||||
case CL_ADAPTER_DXVA_KHR:
|
case CL_ADAPTER_DXVA_KHR:
|
||||||
device = std::auto_ptr<CDeviceWrapper>(new CDXVAWrapper());
|
device = std::unique_ptr<CDeviceWrapper>(new CDXVAWrapper());
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
@@ -1551,7 +1551,7 @@ void SurfaceFormatToString(TSurfaceFormat surfaceFormat, std::string &str)
|
|||||||
bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
unsigned int width, unsigned int height,
|
unsigned int width, unsigned int height,
|
||||||
TSurfaceFormat surfaceFormat, CDeviceWrapper &device,
|
TSurfaceFormat surfaceFormat, CDeviceWrapper &device,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
bool sharedHandle, void **objectSharedHandle)
|
bool sharedHandle, void **objectSharedHandle)
|
||||||
{
|
{
|
||||||
switch (adapterType)
|
switch (adapterType)
|
||||||
@@ -1559,7 +1559,7 @@ bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
case CL_ADAPTER_D3D9_KHR: {
|
case CL_ADAPTER_D3D9_KHR: {
|
||||||
surface =
|
surface =
|
||||||
std::auto_ptr<CD3D9SurfaceWrapper>(new CD3D9SurfaceWrapper);
|
std::unique_ptr<CD3D9SurfaceWrapper>(new CD3D9SurfaceWrapper);
|
||||||
CD3D9SurfaceWrapper *d3dSurface =
|
CD3D9SurfaceWrapper *d3dSurface =
|
||||||
static_cast<CD3D9SurfaceWrapper *>(surface.get());
|
static_cast<CD3D9SurfaceWrapper *>(surface.get());
|
||||||
HRESULT hr = 0;
|
HRESULT hr = 0;
|
||||||
@@ -1578,7 +1578,7 @@ bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
|||||||
break;
|
break;
|
||||||
case CL_ADAPTER_D3D9EX_KHR: {
|
case CL_ADAPTER_D3D9EX_KHR: {
|
||||||
surface =
|
surface =
|
||||||
std::auto_ptr<CD3D9SurfaceWrapper>(new CD3D9SurfaceWrapper);
|
std::unique_ptr<CD3D9SurfaceWrapper>(new CD3D9SurfaceWrapper);
|
||||||
CD3D9SurfaceWrapper *d3dSurface =
|
CD3D9SurfaceWrapper *d3dSurface =
|
||||||
static_cast<CD3D9SurfaceWrapper *>(surface.get());
|
static_cast<CD3D9SurfaceWrapper *>(surface.get());
|
||||||
HRESULT hr = 0;
|
HRESULT hr = 0;
|
||||||
@@ -1598,7 +1598,7 @@ bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
|||||||
break;
|
break;
|
||||||
case CL_ADAPTER_DXVA_KHR: {
|
case CL_ADAPTER_DXVA_KHR: {
|
||||||
surface =
|
surface =
|
||||||
std::auto_ptr<CD3D9SurfaceWrapper>(new CD3D9SurfaceWrapper);
|
std::unique_ptr<CD3D9SurfaceWrapper>(new CD3D9SurfaceWrapper);
|
||||||
CD3D9SurfaceWrapper *d3dSurface =
|
CD3D9SurfaceWrapper *d3dSurface =
|
||||||
static_cast<CD3D9SurfaceWrapper *>(surface.get());
|
static_cast<CD3D9SurfaceWrapper *>(surface.get());
|
||||||
HRESULT hr = 0;
|
HRESULT hr = 0;
|
||||||
|
|||||||
@@ -116,24 +116,24 @@ void YUVGenerateYV12(std::vector<cl_uchar> &yuv, unsigned int width,
|
|||||||
bool YUVGenerate(TSurfaceFormat surfaceFormat, std::vector<cl_uchar> &yuv,
|
bool YUVGenerate(TSurfaceFormat surfaceFormat, std::vector<cl_uchar> &yuv,
|
||||||
unsigned int width, unsigned int height, cl_uchar valueMin,
|
unsigned int width, unsigned int height, cl_uchar valueMin,
|
||||||
cl_uchar valueMax, double valueAdd = 0.0);
|
cl_uchar valueMax, double valueAdd = 0.0);
|
||||||
bool YUVSurfaceSetNV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceSetNV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
const std::vector<cl_uchar> &yuv, unsigned int width,
|
const std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height);
|
unsigned int height);
|
||||||
bool YUVSurfaceSetYV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceSetYV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
const std::vector<cl_uchar> &yuv, unsigned int width,
|
const std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height);
|
unsigned int height);
|
||||||
bool YUVSurfaceSet(TSurfaceFormat surfaceFormat,
|
bool YUVSurfaceSet(TSurfaceFormat surfaceFormat,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
const std::vector<cl_uchar> &yuv, unsigned int width,
|
const std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height);
|
unsigned int height);
|
||||||
bool YUVSurfaceGetNV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceGetNV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
std::vector<cl_uchar> &yuv, unsigned int width,
|
std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height);
|
unsigned int height);
|
||||||
bool YUVSurfaceGetYV12(std::auto_ptr<CSurfaceWrapper> &surface,
|
bool YUVSurfaceGetYV12(std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
std::vector<cl_uchar> &yuv, unsigned int width,
|
std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height);
|
unsigned int height);
|
||||||
bool YUVSurfaceGet(TSurfaceFormat surfaceFormat,
|
bool YUVSurfaceGet(TSurfaceFormat surfaceFormat,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
std::vector<cl_uchar> &yuv, unsigned int width,
|
std::vector<cl_uchar> &yuv, unsigned int width,
|
||||||
unsigned int height);
|
unsigned int height);
|
||||||
bool YUVCompareNV12(const std::vector<cl_uchar> &yuvTest,
|
bool YUVCompareNV12(const std::vector<cl_uchar> &yuvTest,
|
||||||
@@ -178,12 +178,12 @@ bool GetImageInfo(cl_mem object, cl_image_format formatExp,
|
|||||||
size_t slicePitchExp, size_t widthExp, size_t heightExp,
|
size_t slicePitchExp, size_t widthExp, size_t heightExp,
|
||||||
size_t depthExp, unsigned int planeExp);
|
size_t depthExp, unsigned int planeExp);
|
||||||
bool GetMemObjInfo(cl_mem object, cl_dx9_media_adapter_type_khr adapterType,
|
bool GetMemObjInfo(cl_mem object, cl_dx9_media_adapter_type_khr adapterType,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
void *shareHandleExp);
|
void *shareHandleExp);
|
||||||
bool ImageInfoVerify(cl_dx9_media_adapter_type_khr adapterType,
|
bool ImageInfoVerify(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
const std::vector<cl_mem> &memObjList, unsigned int width,
|
const std::vector<cl_mem> &memObjList, unsigned int width,
|
||||||
unsigned int height,
|
unsigned int height,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
void *sharedHandle);
|
void *sharedHandle);
|
||||||
bool ImageFormatCheck(cl_context context, cl_mem_object_type imageType,
|
bool ImageFormatCheck(cl_context context, cl_mem_object_type imageType,
|
||||||
const cl_image_format imageFormatCheck);
|
const cl_image_format imageFormatCheck);
|
||||||
@@ -195,7 +195,7 @@ D3DFORMAT SurfaceFormatToD3D(TSurfaceFormat surfaceFormat);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool DeviceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
bool DeviceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
std::auto_ptr<CDeviceWrapper> &device);
|
std::unique_ptr<CDeviceWrapper> &device);
|
||||||
bool SurfaceFormatCheck(cl_dx9_media_adapter_type_khr adapterType,
|
bool SurfaceFormatCheck(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
const CDeviceWrapper &device,
|
const CDeviceWrapper &device,
|
||||||
TSurfaceFormat surfaceFormat);
|
TSurfaceFormat surfaceFormat);
|
||||||
@@ -204,7 +204,7 @@ void SurfaceFormatToString(TSurfaceFormat surfaceFormat, std::string &str);
|
|||||||
bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType,
|
||||||
unsigned int width, unsigned int height,
|
unsigned int width, unsigned int height,
|
||||||
TSurfaceFormat surfaceFormat, CDeviceWrapper &device,
|
TSurfaceFormat surfaceFormat, CDeviceWrapper &device,
|
||||||
std::auto_ptr<CSurfaceWrapper> &surface,
|
std::unique_ptr<CSurfaceWrapper> &surface,
|
||||||
bool sharedHandle, void **objectSharedHandle);
|
bool sharedHandle, void **objectSharedHandle);
|
||||||
|
|
||||||
cl_int
|
cl_int
|
||||||
|
|||||||
@@ -3196,7 +3196,7 @@ int reference_isgreaterequall(long double x, long double y) { return x >= y; }
|
|||||||
int reference_isinfl(long double x) { return 0 != isinf(x); }
|
int reference_isinfl(long double x) { return 0 != isinf(x); }
|
||||||
int reference_islessl(long double x, long double y) { return x < y; }
|
int reference_islessl(long double x, long double y) { return x < y; }
|
||||||
int reference_islessequall(long double x, long double y) { return x <= y; }
|
int reference_islessequall(long double x, long double y) { return x <= y; }
|
||||||
#if defined(__INTEL_COMPILER)
|
#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
|
||||||
int reference_islessgreaterl(long double x, long double y)
|
int reference_islessgreaterl(long double x, long double y)
|
||||||
{
|
{
|
||||||
return 0 != islessgreaterl(x, y);
|
return 0 != islessgreaterl(x, y);
|
||||||
@@ -3218,7 +3218,7 @@ int reference_isunorderedl(long double x, long double y)
|
|||||||
{
|
{
|
||||||
return isnan(x) || isnan(y);
|
return isnan(x) || isnan(y);
|
||||||
}
|
}
|
||||||
#if defined(__INTEL_COMPILER)
|
#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
|
||||||
int reference_signbitl(long double x) { return 0 != signbitl(x); }
|
int reference_signbitl(long double x) { return 0 != signbitl(x); }
|
||||||
#else
|
#else
|
||||||
int reference_signbitl(long double x) { return 0 != signbit(x); }
|
int reference_signbitl(long double x) { return 0 != signbit(x); }
|
||||||
@@ -3582,7 +3582,8 @@ long double reference_exp2l(long double z)
|
|||||||
|
|
||||||
long double reference_expm1l(long double x)
|
long double reference_expm1l(long double x)
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
|
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) \
|
||||||
|
&& !defined(__INTEL_LLVM_COMPILER)
|
||||||
// unimplemented
|
// unimplemented
|
||||||
return x;
|
return x;
|
||||||
#else
|
#else
|
||||||
@@ -3667,7 +3668,8 @@ long double reference_log2l(long double x)
|
|||||||
|
|
||||||
long double reference_log1pl(long double x)
|
long double reference_log1pl(long double x)
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
|
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) \
|
||||||
|
&& !defined(__INTEL_LLVM_COMPILER)
|
||||||
// unimplemented
|
// unimplemented
|
||||||
return x;
|
return x;
|
||||||
#elif defined(__PPC__)
|
#elif defined(__PPC__)
|
||||||
|
|||||||
@@ -215,7 +215,8 @@ inline void Force64BitFPUPrecision(void)
|
|||||||
__asm__ __volatile__("fstcw %0" : "=m"(orig_cw));
|
__asm__ __volatile__("fstcw %0" : "=m"(orig_cw));
|
||||||
new_cw = orig_cw | 0x0300; // set precision to 64-bit
|
new_cw = orig_cw | 0x0300; // set precision to 64-bit
|
||||||
__asm__ __volatile__("fldcw %0" ::"m"(new_cw));
|
__asm__ __volatile__("fldcw %0" ::"m"(new_cw));
|
||||||
#elif defined(_WIN32) && defined(__INTEL_COMPILER)
|
#elif defined(_WIN32) \
|
||||||
|
&& (defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER))
|
||||||
// Unfortunately, usual method (`_controlfp( _PC_64, _MCW_PC );') does *not*
|
// Unfortunately, usual method (`_controlfp( _PC_64, _MCW_PC );') does *not*
|
||||||
// work on win.x64: > On the x64 architecture, changing the floating point
|
// work on win.x64: > On the x64 architecture, changing the floating point
|
||||||
// precision is not supported. (Taken from
|
// precision is not supported. (Taken from
|
||||||
|
|||||||
Reference in New Issue
Block a user