forked from dmlc/xgboost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reuse main implementation for regression obkective for sycl
- Loading branch information
Dmitry Razdoburdin
committed
Nov 20, 2024
1 parent
ee366c5
commit 934b2a8
Showing
7 changed files
with
141 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright 2021-2024, XGBoost Contributors | ||
* \file transform.h | ||
*/ | ||
#ifndef PLUGIN_SYCL_COMMON_TRANSFORM_H_ | ||
#define PLUGIN_SYCL_COMMON_TRANSFORM_H_ | ||
|
||
#include "../device_manager.h" | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
namespace xgboost { | ||
namespace sycl { | ||
namespace common { | ||
|
||
template <typename Functor, typename... SpanType> | ||
void LaunchSyclKernel(DeviceOrd device, Functor&& _func, xgboost::common::Range _range, | ||
SpanType... _spans) { | ||
sycl::DeviceManager device_manager; | ||
auto* qu = device_manager.GetQueue(device); | ||
|
||
size_t size = *(_range.end()); | ||
qu->submit([&](::sycl::handler& cgh) { | ||
cgh.parallel_for<>(::sycl::range<1>(size), | ||
[=](::sycl::id<1> pid) { | ||
const size_t idx = pid[0]; | ||
const_cast<Functor&&>(_func)(idx, _spans...); | ||
}); | ||
}).wait(); | ||
} | ||
|
||
} // namespace common | ||
} // namespace sycl | ||
} // namespace xgboost | ||
#endif // PLUGIN_SYCL_COMMON_TRANSFORM_H_ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.