mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
@@ -669,6 +669,8 @@ typedef cl_int (CL_API_CALL* PFNCLENQUEUETASKPROC)(cl_command_queue, c
|
||||
typedef cl_int (CL_API_CALL* PFNCLENQUEUENATIVEKERNELPROC)(cl_command_queue, void (CL_CALLBACK*)(void*), void*, size_t, cl_uint, const cl_mem*, const void**, cl_uint, const cl_event*, cl_event*);
|
||||
|
||||
// 1.1
|
||||
typedef cl_mem (CL_API_CALL* PFNCLCREATEIMAGE2DPROC)(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, void*, cl_int*);
|
||||
typedef cl_mem (CL_API_CALL* PFNCLCREATEIMAGE3DPROC)(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, size_t, size_t, void*, cl_int*);
|
||||
typedef cl_mem (CL_API_CALL* PFNCLCREATESUBBUFFERPROC)(cl_mem, cl_mem_flags, cl_buffer_create_type, const void*, cl_int*);
|
||||
typedef cl_int (CL_API_CALL* PFNCLSETMEMOBJECTDESTRUCTORCALLBACKPROC)(cl_mem, void (CL_CALLBACK*)(cl_mem, void*), void*);
|
||||
typedef cl_event (CL_API_CALL* PFNCLCREATEUSEREVENTPROC)(cl_context, cl_int*);
|
||||
@@ -769,6 +771,8 @@ typedef cl_int (CL_API_CALL* PFNCLENQUEUEBARRIERWITHWAITLISTPROC)(cl_c
|
||||
|
||||
#define BX_CL_IMPORT_ALL_11 \
|
||||
/* Memory Object APIs */ \
|
||||
BX_CL_IMPORT_11(false, PFNCLCREATEIMAGE2DPROC, clCreateImage2D); \
|
||||
BX_CL_IMPORT_11(false, PFNCLCREATEIMAGE3DPROC, clCreateImage3D); \
|
||||
BX_CL_IMPORT_11(false, PFNCLCREATESUBBUFFERPROC, clCreateSubBuffer); \
|
||||
BX_CL_IMPORT_11(false, PFNCLSETMEMOBJECTDESTRUCTORCALLBACKPROC, clSetMemObjectDestructorCallback); \
|
||||
/* Event Object APIs */ \
|
||||
|
||||
@@ -87,16 +87,40 @@ namespace bx
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasArg(float& _value, const char _short, const char* _long = NULL) const
|
||||
{
|
||||
const char* arg = findOption(_short, _long, 1);
|
||||
if (NULL != arg)
|
||||
{
|
||||
_value = float(atof(arg));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasArg(double& _value, const char _short, const char* _long = NULL) const
|
||||
{
|
||||
const char* arg = findOption(_short, _long, 1);
|
||||
if (NULL != arg)
|
||||
{
|
||||
_value = atof(arg);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasArg(bool& _value, const char _short, const char* _long = NULL) const
|
||||
{
|
||||
const char* arg = findOption(_short, _long, 1);
|
||||
if (NULL != arg)
|
||||
{
|
||||
if ('0' == *arg || stricmp(arg, "false") )
|
||||
if ('0' == *arg || (0 == stricmp(arg, "false") ) )
|
||||
{
|
||||
_value = false;
|
||||
}
|
||||
else if ('0' != *arg || stricmp(arg, "true") )
|
||||
else if ('0' != *arg || (0 == stricmp(arg, "true") ) )
|
||||
{
|
||||
_value = true;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace bx
|
||||
|
||||
const char* cmp = _find + 1;
|
||||
size_t len = strlen(cmp);
|
||||
do
|
||||
do
|
||||
{
|
||||
for (char match = *_str++; match != first && 0 < _size; match = *_str++, --_size)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace bx
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
} while (0 != strncmp(_str, cmp, len) );
|
||||
|
||||
return --_str;
|
||||
|
||||
Reference in New Issue
Block a user