Skip to content

Commit 874826d

Browse files
committed
format
1 parent 7ca9171 commit 874826d

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

ggml/src/ggml-sycl/common.hpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static int g_ggml_sycl_debug = 0;
6363
// define for XMX in Intel GPU
6464
// TODO: currently, it's not used for XMX really.
6565
#if !defined(GGML_SYCL_FORCE_MMQ)
66-
#define SYCL_USE_XMX
66+
#define SYCL_USE_XMX
6767
#endif
6868

6969
// max batch size to use MMQ kernels when tensor cores are available
@@ -84,16 +84,16 @@ static int g_ggml_sycl_debug = 0;
8484
typedef sycl::queue *queue_ptr;
8585

8686
enum ggml_sycl_backend_gpu_mode {
87-
SYCL_UNSET_GPU_MODE = -1,
88-
SYCL_SINGLE_GPU_MODE = 0,
89-
SYCL_MUL_GPU_MODE
87+
SYCL_UNSET_GPU_MODE = -1,
88+
SYCL_SINGLE_GPU_MODE = 0,
89+
SYCL_MUL_GPU_MODE
9090
};
9191

9292
static_assert(sizeof(sycl::half) == sizeof(ggml_fp16_t), "wrong fp16 size");
9393

9494
static void crash() {
95-
int* ptr = NULL;
96-
*ptr = 0;
95+
int* ptr = NULL;
96+
*ptr = 0;
9797
}
9898

9999
[[noreturn]] static void ggml_sycl_error(
@@ -102,9 +102,9 @@ static void crash() {
102102
const char* file,
103103
const int line,
104104
const char* msg) {
105-
fprintf(stderr, "SYCL error: %s: %s\n", stmt, msg);
106-
fprintf(stderr, " in function %s at %s:%d\n", func, file, line);
107-
GGML_ABORT("SYCL error");
105+
fprintf(stderr, "SYCL error: %s: %s\n", stmt, msg);
106+
fprintf(stderr, " in function %s at %s:%d\n", func, file, line);
107+
GGML_ABORT("SYCL error");
108108
}
109109

110110
#define SYCL_CHECK(err) \
@@ -141,40 +141,40 @@ static int g_all_sycl_device_count = -1;
141141
static bool g_ggml_backend_sycl_buffer_type_initialized = false;
142142

143143
static ggml_sycl_backend_gpu_mode g_ggml_sycl_backend_gpu_mode =
144-
SYCL_UNSET_GPU_MODE;
144+
SYCL_UNSET_GPU_MODE;
145145

146146
static void* g_scratch_buffer = nullptr;
147147
static size_t g_scratch_size = 0; // disabled by default
148148
static size_t g_scratch_offset = 0;
149149

150150
[[noreturn]] static inline void bad_arch(const sycl::stream& stream_ct1) {
151-
stream_ct1 << "ERROR: ggml-sycl was compiled without support for the "
152-
"current GPU architecture.\n";
153-
// __trap();
154-
std::exit(1);
151+
stream_ct1 << "ERROR: ggml-sycl was compiled without support for the "
152+
"current GPU architecture.\n";
153+
// __trap();
154+
std::exit(1);
155155

156-
(void)bad_arch; // suppress unused function warning
156+
(void)bad_arch; // suppress unused function warning
157157
}
158158

159159
int get_current_device_id();
160160

161161
inline dpct::err0 ggml_sycl_set_device(const int device) try {
162162

163-
int current_device_id;
164-
SYCL_CHECK(CHECK_TRY_ERROR(current_device_id = get_current_device_id()));
163+
int current_device_id;
164+
SYCL_CHECK(CHECK_TRY_ERROR(current_device_id = get_current_device_id()));
165165

166-
// GGML_SYCL_DEBUG("ggml_sycl_set_device device_id=%d,
167-
// current_device_id=%d\n", device, current_device);
168-
if (device == current_device_id) {
169-
return 0;
170-
}
166+
// GGML_SYCL_DEBUG("ggml_sycl_set_device device_id=%d,
167+
// current_device_id=%d\n", device, current_device);
168+
if (device == current_device_id) {
169+
return 0;
170+
}
171171

172-
return CHECK_TRY_ERROR(dpct::select_device(device));
172+
return CHECK_TRY_ERROR(dpct::select_device(device));
173173
} catch (sycl::exception const& exc) {
174-
std::cerr << exc.what() << "Exception caught at file:" << __FILE__
175-
<< ", line:" << __LINE__ << std::endl;
176-
crash();
177-
std::exit(1);
174+
std::cerr << exc.what() << "Exception caught at file:" << __FILE__
175+
<< ", line:" << __LINE__ << std::endl;
176+
crash();
177+
std::exit(1);
178178
}
179179

180180
//////////////////////
@@ -252,10 +252,10 @@ struct ggml_sycl_pool_alloc {
252252
// backend interface
253253

254254
struct ggml_tensor_extra_gpu {
255-
void* data_device[GGML_SYCL_MAX_DEVICES]; // 1 pointer for each device for split
256-
// tensors
257-
dpct::event_ptr events[GGML_SYCL_MAX_DEVICES]
258-
[GGML_SYCL_MAX_STREAMS]; // events for synchronizing multiple GPUs
255+
void* data_device[GGML_SYCL_MAX_DEVICES]; // 1 pointer for each device for split
256+
// tensors
257+
dpct::event_ptr events[GGML_SYCL_MAX_DEVICES]
258+
[GGML_SYCL_MAX_STREAMS]; // events for synchronizing multiple GPUs
259259
};
260260

261261
struct ggml_backend_sycl_context {

0 commit comments

Comments
 (0)