Skip to content

Commit

Permalink
attempt to compile unary functions for CPU only
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 3, 2024
1 parent 4d9c76e commit 7e5ba6d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set(legateboost_srcs
models/tree/build_tree.cc
models/tree/update_tree.cc
models/tree/predict.cc
models/krr/rbf.cc
models/nn/build_nn.cc
cpp_utils/cpp_utils.h
cpp_utils/cpp_utils.cc
Expand Down
2 changes: 2 additions & 0 deletions src/cpp_utils/cpp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ class UnaryOpTask : public Task<UnaryOpTask<F, OpCode>, OpCode> {
auto const& in = context.input(0);
legate::dim_dispatch(in.dim(), DispatchDimOp{}, context, in, thrust::host);
}
#ifdef LEGATEBOOST_USE_CUDA
static void gpu_variant(legate::TaskContext context);
#endif
};

} // namespace legateboost
Expand Down
26 changes: 26 additions & 0 deletions src/models/krr/rbf.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

/* Copyright 2024 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "rbf.h"
namespace // unnamed
{
#ifndef LEGATEBOOST_USE_CUDA
static void __attribute__((constructor)) register_tasks(void)
{
legateboost::RbfTask::register_variants();
}
#endif
} // namespace
28 changes: 28 additions & 0 deletions src/special/special.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* Copyright 2023-2024, NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "special.h"
namespace // unnamed
{
#ifndef LEGATEBOOST_USE_CUDA
static void __attribute__((constructor)) register_tasks(void)
{
legateboost::ErfTask::register_variants();
legateboost::LgammaTask::register_variants();
legateboost::TgammaTask::register_variants();
legateboost::DigammaTask::register_variants();
legateboost::ZetaTask::register_variants();
}
#endif
} // namespace

0 comments on commit 7e5ba6d

Please sign in to comment.