Add files via upload

This commit is contained in:
Yutaka Sawada
2023-03-12 11:01:22 +09:00
committed by GitHub
parent 86015cf083
commit dcd8047d73
20 changed files with 15669 additions and 0 deletions

34
source/par2j/lib_opencl.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef _OPENCL_H_
#define _OPENCL_H_
#ifdef __cplusplus
extern "C" {
#endif
// IntelやAMDのGPUでZeroCopyするにはメモリー境界をこの値にしないといけない
#define MEM_UNIT 4096
extern int OpenCL_method;
int init_OpenCL(int unit_size, int *src_max, int *chunk_size);
int free_OpenCL(void);
void info_OpenCL(char *buf, int buf_size);
int gpu_copy_blocks(
unsigned char *data,
int unit_size,
int src_end);
int gpu_multiply_blocks(
int src_num, // Number of multiplying source blocks
unsigned short *mat, // Matrix of numbers to multiply by
unsigned char *buf, // Products go here
int len); // Byte length
int gpu_finish(void);
#ifdef __cplusplus
}
#endif
#endif