Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
samir-nasibli committed Sep 30, 2024
1 parent 05473c5 commit 1c0933b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
26 changes: 1 addition & 25 deletions onedal/datatypes/data_conversion_sua_iface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,6 @@ void report_problem_to_sua_iface(const char* clarification) {
throw std::runtime_error{ message };
}

// TODO:
// re-use convert_dal_to_sua_type instead.
std::string get_npy_typestr(const dal::data_type dtype) {
switch (dtype) {
case dal::data_type::float32: {
return "<f4";
break;
}
case dal::data_type::float64: {
return "<f8";
break;
}
case dal::data_type::int32: {
return "<i4";
break;
}
case dal::data_type::int64: {
return "<i8";
break;
}
default: report_problem_to_sua_iface(": unknown data type");
};
}

py::tuple get_npy_strides(const dal::data_layout& data_layout,
npy_intp row_count,
npy_intp column_count) {
Expand Down Expand Up @@ -301,7 +277,7 @@ py::dict construct_sua_iface(const dal::table& input) {
iface["strides"] = get_npy_strides(data_layout, row_count, column_count);
// dpctl supports only version 1.
iface["version"] = 1;
iface["typestr"] = get_npy_typestr(dtype);
iface["typestr"] = convert_dal_to_sua_type(dtype);
iface["syclobj"] = pack_queue(queue);

return iface;
Expand Down
4 changes: 4 additions & 0 deletions sklearnex/tests/test_memory_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ def test_gpu_memory_leaks(estimator, queue, order, data_shape):
_kfold_function_template(GPU_ESTIMATORS[estimator], None, data_shape, queue, func)


@pytest.mark.skipif(
dpctl_available,
reason="dpctl.tensor is required for testing.",
)
@pytest.mark.parametrize(
"dataframe,queue", get_dataframes_and_queues("dpctl, dpnp", "cpu, gpu")
)
Expand Down

0 comments on commit 1c0933b

Please sign in to comment.