Kaydet (Commit) c24eba06 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

C++ style struct / enum declarations without typedef.

Change-Id: Idf9e7ddaf4b28c00222470460478631c37c79a6b
üst e3ece4b3
...@@ -42,11 +42,11 @@ bool bIsInited = false; ...@@ -42,11 +42,11 @@ bool bIsInited = false;
bool bIsDeviceSelected = false; bool bIsDeviceSelected = false;
ds_device selectedDevice; ds_device selectedDevice;
typedef struct LibreOfficeDeviceScore struct LibreOfficeDeviceScore
{ {
double fTime; // small time means faster device double fTime; // small time means faster device
bool bNoCLErrors; // were there any opencl errors bool bNoCLErrors; // were there any opencl errors
} LibreOfficeDeviceScore; };
struct LibreOfficeDeviceEvaluationIO struct LibreOfficeDeviceEvaluationIO
{ {
...@@ -59,14 +59,14 @@ struct LibreOfficeDeviceEvaluationIO ...@@ -59,14 +59,14 @@ struct LibreOfficeDeviceEvaluationIO
unsigned long outputSize; unsigned long outputSize;
}; };
typedef struct timer struct timer
{ {
#ifdef _WIN32 #ifdef _WIN32
LARGE_INTEGER start, stop, frequency; LARGE_INTEGER start, stop, frequency;
#else #else
long long start, stop, frequency; long long start, stop, frequency;
#endif #endif
} timer; };
const char* source = STRINGIFY( const char* source = STRINGIFY(
\n#if defined(KHR_DP_EXTENSION) \n#if defined(KHR_DP_EXTENSION)
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#define DS_DEVICE_NAME_LENGTH 256 #define DS_DEVICE_NAME_LENGTH 256
typedef enum { enum ds_status
{
DS_SUCCESS = 0 DS_SUCCESS = 0
,DS_INVALID_PROFILE = 1000 ,DS_INVALID_PROFILE = 1000
,DS_MEMORY_ERROR ,DS_MEMORY_ERROR
...@@ -34,28 +35,31 @@ typedef enum { ...@@ -34,28 +35,31 @@ typedef enum {
, DS_PROFILE_FILE_ERROR , DS_PROFILE_FILE_ERROR
, DS_SCORE_SERIALIZER_ERROR , DS_SCORE_SERIALIZER_ERROR
, DS_SCORE_DESERIALIZER_ERROR , DS_SCORE_DESERIALIZER_ERROR
} ds_status; };
// device type // device type
typedef enum { enum ds_device_type
{
DS_DEVICE_NATIVE_CPU = 0 DS_DEVICE_NATIVE_CPU = 0
,DS_DEVICE_OPENCL_DEVICE ,DS_DEVICE_OPENCL_DEVICE
} ds_device_type; };
typedef struct { struct ds_device
{
ds_device_type type; ds_device_type type;
cl_device_id oclDeviceID; cl_device_id oclDeviceID;
char* oclDeviceName; char* oclDeviceName;
char* oclDriverVersion; char* oclDriverVersion;
void* score; // a pointer to the score data, the content/format is application defined void* score; // a pointer to the score data, the content/format is application defined
} ds_device; };
typedef struct { struct ds_profile
{
unsigned int numDevices; unsigned int numDevices;
ds_device* devices; ds_device* devices;
const char* version; const char* version;
} ds_profile; };
// deallocate memory used by score // deallocate memory used by score
typedef ds_status(* ds_score_release)(void* score); typedef ds_status(* ds_score_release)(void* score);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment