Skip to content
Draft
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
skip: ["mypy", "verify-alpha-spec"]
skip: ["mypy", "verify-alpha-spec", "verify-thrust-exec-policy"]
submodules: false

repos:
Expand Down Expand Up @@ -98,12 +98,6 @@ repos:
entry: 'pytest\.xfail'
language: pygrep
types: [python]
- id: use-exec-policy-nosync
name: use-exec-policy-nosync
description: 'Enforce that rmm::exec_policy_nosync is used instead of rmm::exec_policy (see developer guide)'
entry: 'rmm::exec_policy\('
language: pygrep
types_or: [c, c++, cuda]
- id: no-unseeded-default-rng
name: no-unseeded-default-rng
description: 'Enforce that no non-seeded default_rng is used and default_rng is used instead of np.random.seed'
Expand Down Expand Up @@ -144,6 +138,14 @@ repos:
language: system
pass_filenames: false
verbose: true
- id: verify-thrust-exec-policy
name: verify-thrust-exec-policy
description: 'Enforce that rmm::exec_policy_nosync is used when possible (see developer guide)'
entry: ./ci/checks/verify_thrust_exec_policy.sh
types_or: [c, c++, cuda]
language: python
pass_filenames: false
verbose: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
Expand Down
8 changes: 8 additions & 0 deletions ci/checks/verify_thrust_exec_policy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
###############################
# libcudf verify thrust execution policy check
###############################

python cpp/scripts/verify_thrust_exec_policy.py
2 changes: 1 addition & 1 deletion cpp/doxygen/developer_guide/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ All headers in cudf should use `#pragma once` for include guards.

Only use `.cu` and `.cuh` if necessary. A good indicator is the inclusion of `__device__` and other
symbols that are only recognized by `nvcc`. Another indicator is Thrust algorithm APIs with a device
execution policy (always `rmm::exec_policy_nosync` in libcudf).
execution policy (always use `rmm::exec_policy_nosync` in libcudf when the return value is not required).

## Code and Documentation Style and Formatting

Expand Down
Loading