SWDEV-301289 - Treewide macro rename
ATI_OS_WIN -> _WIN32 ATI_OS_LINUX -> __linux__ We should not rely on non-standard macros for platform detections. Change-Id: If1d06e2e1187268df62a59609ea5496ab7eb709d
This commit is contained in:
1 orang tua
159f7f24cd
melakukan
c4aa6febe5
27 files changed
+92
-93
No files matched your search
@@ -45,7 +45,7 @@ BaseTestImp::BaseTestImp()
|
||||
_platformIndex = 0;
|
||||
_perfInfo = 0.0f;
|
||||
|
||||
#ifdef ATI_OS_LINUX //
|
||||
#ifdef __linux__ //
|
||||
_useThreads = 0; // disable threads on linux
|
||||
#else
|
||||
_useThreads = 1; // if available on platform
|
||||
|
||||
@@ -24,7 +24,6 @@ set_target_properties(Common PROPERTIES
|
||||
|
||||
target_compile_definitions(Common
|
||||
PUBLIC
|
||||
ATI_OS_LINUX
|
||||
CL_TARGET_OPENCL_VERSION=220)
|
||||
|
||||
if(OPENGL_FOUND AND GLEW_FOUND)
|
||||
|
||||
@@ -241,7 +241,7 @@ void OCLTestImp::setOCLWrapper(OCLWrapper* wrapper) { _wrapper = wrapper; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@@ -251,11 +251,11 @@ static int initializeSeed(void) {
|
||||
return (int)val;
|
||||
}
|
||||
|
||||
#endif // ATI_OS_WIN
|
||||
#endif // _WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
@@ -265,7 +265,7 @@ static int initializeSeed(void) {
|
||||
return (int)t.tv_usec;
|
||||
}
|
||||
|
||||
#endif // ATI_OS_LINUX
|
||||
#endif // __linux__
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "OCL/Thread.h"
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef struct __argsToThreadFunc {
|
||||
|
||||
} argsToThreadFunc;
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
//! Windows thread callback - invokes the callback set by
|
||||
//! the application in OCLThread constructor
|
||||
unsigned _stdcall win32ThreadFunc(void *args) {
|
||||
@@ -54,7 +54,7 @@ unsigned _stdcall win32ThreadFunc(void *args) {
|
||||
//! Constructor for OCLLock
|
||||
//!
|
||||
OCLutil::Lock::Lock() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
InitializeCriticalSection(&_cs);
|
||||
#else
|
||||
pthread_mutex_init(&_lock, NULL);
|
||||
@@ -66,7 +66,7 @@ OCLutil::Lock::Lock() {
|
||||
//! Destructor for OCLLock
|
||||
//!
|
||||
OCLutil::Lock::~Lock() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
DeleteCriticalSection(&_cs);
|
||||
#else
|
||||
pthread_mutex_destroy(&_lock);
|
||||
@@ -79,7 +79,7 @@ OCLutil::Lock::~Lock() {
|
||||
//! else hold the lock and enter the protected area
|
||||
//!
|
||||
void OCLutil::Lock::lock() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
EnterCriticalSection(&_cs);
|
||||
#else
|
||||
pthread_mutex_lock(&_lock);
|
||||
@@ -93,7 +93,7 @@ void OCLutil::Lock::lock() {
|
||||
//! section as well in this case).
|
||||
//!
|
||||
bool OCLutil::Lock::tryLock() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
return (TryEnterCriticalSection(&_cs) != 0);
|
||||
#else
|
||||
return !((bool)pthread_mutex_trylock(&_lock));
|
||||
@@ -105,7 +105,7 @@ bool OCLutil::Lock::tryLock() {
|
||||
//! Unlock the lock
|
||||
//!
|
||||
void OCLutil::Lock::unlock() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
LeaveCriticalSection(&_cs);
|
||||
#else
|
||||
pthread_mutex_unlock(&_lock);
|
||||
@@ -117,7 +117,7 @@ void OCLutil::Lock::unlock() {
|
||||
//! Constructor for OCLThread
|
||||
//!
|
||||
OCLutil::Thread::Thread() : _tid(0), _data(0) {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
_ID = 0;
|
||||
#else
|
||||
#endif
|
||||
@@ -128,7 +128,7 @@ OCLutil::Thread::Thread() : _tid(0), _data(0) {
|
||||
//! Destructor for OCLLock
|
||||
//!
|
||||
OCLutil::Thread::~Thread() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
CloseHandle(_tid);
|
||||
#else
|
||||
#endif
|
||||
@@ -146,7 +146,7 @@ bool OCLutil::Thread::create(oclThreadFunc func, void *arg) {
|
||||
|
||||
bool verbose = getenv("VERBOSE") != NULL;
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
// Setup the callback struct for thread function and pass to the
|
||||
// begin thread routine
|
||||
// xxx The following struct is allocated but never freed!!!!
|
||||
@@ -180,7 +180,7 @@ bool OCLutil::Thread::create(oclThreadFunc func, void *arg) {
|
||||
//! Return the thread ID for the current OCLThread
|
||||
//!
|
||||
unsigned int OCLutil::Thread::getID() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
return GetCurrentThreadId();
|
||||
// Type cast the thread handle to unsigned in and send it over
|
||||
#else
|
||||
@@ -193,7 +193,7 @@ unsigned int OCLutil::Thread::getID() {
|
||||
//! Wait for this thread to join
|
||||
//!
|
||||
bool OCLutil::Thread::join() {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
DWORD rc = WaitForSingleObject(_tid, INFINITE);
|
||||
|
||||
if (rc == WAIT_FAILED) {
|
||||
|
||||
@@ -20,23 +20,23 @@
|
||||
|
||||
#include "Timer.h"
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
#include <time.h>
|
||||
#define NANOSECONDS_PER_SEC 1000000000
|
||||
#endif
|
||||
|
||||
CPerfCounter::CPerfCounter() : _clocks(0), _start(0) {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
|
||||
QueryPerformanceFrequency((LARGE_INTEGER *)&_freq);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
_freq = NANOSECONDS_PER_SEC;
|
||||
#endif
|
||||
}
|
||||
@@ -46,7 +46,7 @@ CPerfCounter::~CPerfCounter() {
|
||||
}
|
||||
|
||||
void CPerfCounter::Start(void) {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
|
||||
if (_start) {
|
||||
MessageBox(NULL, "Bad Perf Counter Start", "Error", MB_OK);
|
||||
@@ -55,7 +55,7 @@ void CPerfCounter::Start(void) {
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&_start);
|
||||
|
||||
#endif
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
|
||||
struct timespec s;
|
||||
clock_gettime(CLOCK_MONOTONIC, &s);
|
||||
@@ -67,7 +67,7 @@ void CPerfCounter::Start(void) {
|
||||
void CPerfCounter::Stop(void) {
|
||||
i64 n;
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
|
||||
if (!_start) {
|
||||
MessageBox(NULL, "Bad Perf Counter Stop", "Error", MB_OK);
|
||||
@@ -77,7 +77,7 @@ void CPerfCounter::Stop(void) {
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&n);
|
||||
|
||||
#endif
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
|
||||
struct timespec s;
|
||||
clock_gettime(CLOCK_MONOTONIC, &s);
|
||||
@@ -91,7 +91,7 @@ void CPerfCounter::Stop(void) {
|
||||
}
|
||||
|
||||
void CPerfCounter::Reset(void) {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
if (_start) {
|
||||
MessageBox(NULL, "Bad Perf Counter Reset", "Error", MB_OK);
|
||||
exit(0);
|
||||
@@ -101,7 +101,7 @@ void CPerfCounter::Reset(void) {
|
||||
}
|
||||
|
||||
double CPerfCounter::GetElapsedTime(void) {
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
if (_start) {
|
||||
MessageBox(NULL, "Trying to get time while still running.", "Error", MB_OK);
|
||||
exit(0);
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#ifndef _TIMER_H_
|
||||
#define _TIMER_H_
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
typedef __int64 i64;
|
||||
#endif
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
typedef long long i64;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//
|
||||
// Includes for tests
|
||||
//
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
#include "OCLDX11YUY2.h"
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ static void* dictionary_CreateTestFunc(void) {
|
||||
#define TEST(name) \
|
||||
{ #name, &dictionary_CreateTestFunc < name> }
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
|
||||
TestEntry TestList[] = {TEST(OCLDX11YUY2)};
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
//
|
||||
// Testing module (plugin) interface forward declarations
|
||||
//
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
#define OCL_DLLEXPORT __declspec(dllexport)
|
||||
#define OCL_CALLCONV __cdecl
|
||||
#endif
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
#define OCL_DLLEXPORT
|
||||
#define OCL_CALLCONV
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef _OCL_INCLUDES_H
|
||||
#define _OCL_INCLUDES_H
|
||||
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
#define POINTER_64 __ptr64
|
||||
#include <windows.h>
|
||||
#include "d3d9.h"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <sstream>
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ void OCLCreateBuffer::run(void) {
|
||||
_wrapper->clFinish(cmdQueues_[_deviceId]);
|
||||
|
||||
size_t maxSteps = maxSize_;
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
long pages = sysconf(_SC_PHYS_PAGES);
|
||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
if (maxSteps > (size_t)(pages * page_size / 2)) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <sstream>
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
#include <sys/sysinfo.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -194,7 +194,7 @@ void OCLCreateImage::open(unsigned int test, char *units, double &conversion,
|
||||
if (ImageSizeY >= max2DHeight) {
|
||||
ImageSizeY = max2DHeight - 0x1000;
|
||||
}
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
// On linux, if the size of total system memory is less than 4GB,
|
||||
// then, we can allocate much smaller image.
|
||||
// TODO, need to find the root cause
|
||||
@@ -289,7 +289,7 @@ void OCLCreateImage::open(unsigned int test, char *units, double &conversion,
|
||||
float *data;
|
||||
size_t ActualImageSizeY = ImageSizeY;
|
||||
size_t maxImageSize = maxSize_;
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
long pages = sysconf(_SC_PHYS_PAGES);
|
||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
if (maxImageSize > ((size_t)pages * page_size)) {
|
||||
@@ -357,7 +357,7 @@ void OCLCreateImage::open(unsigned int test, char *units, double &conversion,
|
||||
|
||||
size_t ActualImageSizeZ = ImageSizeZ;
|
||||
size_t maxImageSize = maxSize_;
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
long pages = sysconf(_SC_PHYS_PAGES);
|
||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
if (maxImageSize > ((size_t)pages * page_size)) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "CL/cl.h"
|
||||
#include "CL/cl_ext.h"
|
||||
|
||||
#if !defined(ATI_OS_LINUX)
|
||||
#if !defined(__linux__)
|
||||
#include "WinBase.h"
|
||||
typedef DWORD(WINAPI* GetThreadId)(__in HANDLE Thread);
|
||||
#endif
|
||||
@@ -63,7 +63,7 @@ void OCLGetQueueThreadID::open(unsigned int test, char* units,
|
||||
static void CL_CALLBACK notify_callback(cl_event event,
|
||||
cl_int event_command_exec_status,
|
||||
void* user_data) {
|
||||
#if defined(ATI_OS_LINUX)
|
||||
#if defined(__linux__)
|
||||
pthread_t id = (pthread_t)user_data;
|
||||
pthread_t handle = pthread_self();
|
||||
#else
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <sstream>
|
||||
#ifdef ATI_OS_LINUX
|
||||
#ifdef __linux__
|
||||
#include <sys/sysinfo.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,7 @@ void OCLStablePState::run(void) {
|
||||
cl_set_device_clock_mode_output_amd setClockModeOutput = {};
|
||||
error_ = _wrapper->clSetDeviceClockModeAMD(gpu_device, setClockModeInput,
|
||||
&setClockModeOutput);
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
CHECK_RESULT(error_ != CL_SUCCESS, "SetClockMode profiling failed\n");
|
||||
#else
|
||||
error_ = CL_SUCCESS;
|
||||
@@ -119,7 +119,7 @@ void OCLStablePState::run(void) {
|
||||
setClockModeOutput = {};
|
||||
error_ = _wrapper->clSetDeviceClockModeAMD(gpu_device, setClockModeInput,
|
||||
&setClockModeOutput);
|
||||
#ifdef ATI_OS_WIN
|
||||
#ifdef _WIN32
|
||||
CHECK_RESULT(error_ != CL_SUCCESS, "SetClockMode default failed\n");
|
||||
#else
|
||||
error_ = CL_SUCCESS;
|
||||
|
||||
Reference in new issue
Block a user