mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 17:44:38 +00:00
integrated optional (experimentl) CLBlast support
This commit is contained in:
parent
c9f18082fd
commit
23c675b2e6
53 changed files with 22095 additions and 151 deletions
42
CL/Utils/File.h
Normal file
42
CL/Utils/File.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
|
||||
// OpenCL Utils includes
|
||||
#include "OpenCLUtils_Export.h"
|
||||
|
||||
// OpenCL includes
|
||||
#include <CL/cl.h>
|
||||
|
||||
// read all the text file contents securely in ANSI C89
|
||||
// return pointer to C-string with file contents
|
||||
// can handle streams with no known size and no support for fseek
|
||||
// based on https://stackoverflow.com/questions/14002954/ by Nominal Animal
|
||||
UTILS_EXPORT
|
||||
char* cl_util_read_text_file(const char* const filename, size_t* const length,
|
||||
cl_int* const error);
|
||||
|
||||
// read all the binary file contents securely in ANSI C89
|
||||
// return pointer to file contents
|
||||
// can handle streams with no known size and no support for fseek
|
||||
// based on https://stackoverflow.com/questions/14002954/ by Nominal Animal
|
||||
UTILS_EXPORT
|
||||
unsigned char* cl_util_read_binary_file(const char* const filename,
|
||||
size_t* const length,
|
||||
cl_int* const error);
|
||||
|
||||
// write binaries of OpenCL compiled program
|
||||
// binaries are written as separate files for each device
|
||||
// with file name "(program_file_name)_(name of device).bin"
|
||||
// based on variant of Logan
|
||||
// http://logan.tw/posts/2014/11/22/pre-compile-the-opencl-kernel-program-part-2/
|
||||
UTILS_EXPORT
|
||||
cl_int cl_util_write_binaries(const cl_program program,
|
||||
const char* const program_file_name);
|
||||
|
||||
// read binaries of OpenCL compiled program
|
||||
// from files of file names "(program_file_name)_(name of device).bin"
|
||||
UTILS_EXPORT
|
||||
cl_program cl_util_read_binaries(const cl_context context,
|
||||
const cl_device_id* const devices,
|
||||
const cl_uint num_devices,
|
||||
const char* const program_file_name,
|
||||
cl_int* const error);
|
Loading…
Add table
Add a link
Reference in a new issue