Skip to content

Commit

Permalink
fix for windows building
Browse files Browse the repository at this point in the history
  • Loading branch information
arthw committed Nov 19, 2024
1 parent 0ed117a commit a979201
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions ggml/include/ggml-sycl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ GGML_BACKEND_API void ggml_backend_sycl_get_device_description(int device,
GGML_BACKEND_API int ggml_backend_sycl_get_device_count();
GGML_BACKEND_API void ggml_backend_sycl_get_device_memory(int device, size_t *free, size_t *total);

GGML_API int ggml_backend_sycl_get_device_index(int device_id);
GGML_API int ggml_backend_sycl_get_device_id(int index);
GGML_API void ggml_sycl_set_single_device(int main_gpu_id);
GGML_BACKEND_API int ggml_backend_sycl_get_device_index(int device_id);
GGML_BACKEND_API int ggml_backend_sycl_get_device_id(int index);
GGML_BACKEND_API void ggml_sycl_set_single_device(int main_gpu_id);

GGML_API void ggml_backend_sycl_set_single_device_mode(int main_gpu_id);
GGML_BACKEND_API void ggml_backend_sycl_set_single_device_mode(int main_gpu_id);

// SYCL doesn't support registering host memory, keep here for reference
// GGML_BACKEND_API bool ggml_backend_sycl_register_host_buffer(void * buffer, size_t size);
Expand Down
10 changes: 5 additions & 5 deletions ggml/src/ggml-sycl/ggml-sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int ggml_backend_sycl_get_device(ggml_backend_t backend);
static bool ggml_backend_buffer_is_sycl_split(ggml_backend_buffer_t buffer);
static bool ggml_backend_buffer_is_sycl(ggml_backend_buffer_t buffer);

GGML_API void ggml_backend_sycl_get_gpu_list(int *id_list, int max_len) try {
GGML_BACKEND_API void ggml_backend_sycl_get_gpu_list(int *id_list, int max_len) try {
GGML_SYCL_DEBUG("[SYCL] call ggml_backend_sycl_get_gpu_list\n");
for(int i=0;i<max_len;i++) id_list[i] = -1;

Expand Down Expand Up @@ -3892,12 +3892,12 @@ bool ggml_sycl_compute_forward(ggml_backend_sycl_context & ctx, struct ggml_tens
return true;
}

GGML_API int ggml_backend_sycl_get_device_id(int index) {
GGML_BACKEND_API int ggml_backend_sycl_get_device_id(int index) {
GGML_SYCL_DEBUG("[SYCL] call ggml_backend_sycl_get_device_id\n");
return ggml_sycl_info().get_device_id(index);
}

GGML_API void ggml_sycl_get_gpu_list(int *id_list, int max_len) try {
GGML_BACKEND_API void ggml_sycl_get_gpu_list(int *id_list, int max_len) try {
GGML_SYCL_DEBUG("[SYCL] call ggml_sycl_get_gpu_list\n");
for(int i=0;i<max_len;i++) id_list[i] = -1;

Expand Down Expand Up @@ -3928,7 +3928,7 @@ catch (sycl::exception const &exc) {
std::exit(1);
}

GGML_API void ggml_backend_sycl_get_device_description(int device_id, char *description,
GGML_BACKEND_API void ggml_backend_sycl_get_device_description(int device_id, char *description,
size_t description_size) try {
GGML_SYCL_DEBUG("[SYCL] call ggml_backend_sycl_get_device_description\n");
dpct::device_info prop;
Expand Down Expand Up @@ -4593,7 +4593,7 @@ ggml_backend_t ggml_backend_sycl_init(int device_id) {
return sycl_backend;
}

GGML_API void ggml_backend_sycl_set_single_device_mode(int main_gpu_id) {
GGML_BACKEND_API void ggml_backend_sycl_set_single_device_mode(int main_gpu_id) {

GGML_SYCL_DEBUG("[SYCL] call ggml_backend_sycl_set_single_device_mode\n");
fprintf(stderr, "ggml_backend_sycl_set_single_device: use single device: [%d]\n", main_gpu_id);
Expand Down

0 comments on commit a979201

Please sign in to comment.