MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / param_update_kernel_half

Function param_update_kernel_half

csrc/xpu/common/custom_cuda_kernel.dp.cpp:67–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void param_update_kernel_half(const float* input, sycl::half* output, int size)
68{
69 auto item_ct1 = sycl::ext::oneapi::experimental::this_nd_item<3>();
70 int id = item_ct1.get_group(2) * item_ct1.get_local_range(2) + item_ct1.get_local_id(2);
71 sycl::half2* output_cast = reinterpret_cast<sycl::half2*>(output);
72 if (id < size) {
73 float input_f = input[id];
74 sycl::half2* input_h = reinterpret_cast<sycl::half2*>(&input_f);
75 output_cast[id] = *input_h;
76 }
77}
78
79void launch_param_update_half(const float* input, sycl::half* output, int size, sycl::queue* stream)
80{

Callers 1

launch_param_update_halfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected