mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 09:34:37 +00:00
wip dont use
This commit is contained in:
parent
7ba36c2c6c
commit
07bb31b034
42 changed files with 8 additions and 7 deletions
|
@ -1,88 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
// OpenCL Utils includes
|
||||
#include "OpenCLUtils_Export.h"
|
||||
|
||||
// OpenCL Utils includes
|
||||
#include <CL/Utils/ErrorCodes.h>
|
||||
|
||||
// STL includes
|
||||
#include <stdio.h> // fprintf
|
||||
|
||||
// OpenCL includes
|
||||
#include <CL/cl.h>
|
||||
|
||||
// RET = function returns error code
|
||||
// PAR = functions sets error code in the paremeter
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
#define OCLERROR_RET(func, err, label) \
|
||||
do \
|
||||
{ \
|
||||
err = func; \
|
||||
if (err != CL_SUCCESS) \
|
||||
{ \
|
||||
cl_util_print_error(err); \
|
||||
fprintf(stderr, "on line %d, in file %s\n%s\n", __LINE__, \
|
||||
__FILE__, #func); \
|
||||
goto label; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define OCLERROR_PAR(func, err, label) \
|
||||
do \
|
||||
{ \
|
||||
func; \
|
||||
if (err != CL_SUCCESS) \
|
||||
{ \
|
||||
cl_util_print_error(err); \
|
||||
fprintf(stderr, "on line %d, in file %s\n%s\n", __LINE__, \
|
||||
__FILE__, #func); \
|
||||
goto label; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define MEM_CHECK(func, err, label) \
|
||||
do \
|
||||
{ \
|
||||
if ((func) == NULL) \
|
||||
{ \
|
||||
err = CL_OUT_OF_HOST_MEMORY; \
|
||||
cl_util_print_error(err); \
|
||||
fprintf(stderr, "on line %d, in file %s\n%s\n", __LINE__, \
|
||||
__FILE__, #func); \
|
||||
goto label; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define OCLERROR_RET(func, err, label) \
|
||||
do \
|
||||
{ \
|
||||
err = func; \
|
||||
if (err != CL_SUCCESS) goto label; \
|
||||
} while (0)
|
||||
|
||||
#define OCLERROR_PAR(func, err, label) \
|
||||
do \
|
||||
{ \
|
||||
func; \
|
||||
if (err != CL_SUCCESS) goto label; \
|
||||
} while (0)
|
||||
|
||||
#define MEM_CHECK(func, err, label) \
|
||||
do \
|
||||
{ \
|
||||
if ((func) == NULL) \
|
||||
{ \
|
||||
err = CL_OUT_OF_HOST_MEMORY; \
|
||||
goto label; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
UTILS_EXPORT
|
||||
void cl_util_print_error(cl_int error);
|
Loading…
Add table
Add a link
Reference in a new issue