From 6c8a45c88c7dd32838cd039c8beef0c9043401d7 Mon Sep 17 00:00:00 2001 From: Allard Hendriksen Date: Tue, 17 Dec 2024 12:24:06 +0100 Subject: [PATCH 1/2] ptx: Add clusterlaunchcontrol --- .../ptx/instructions/clusterlaunchcontrol.rst | 11 ++++++ .../__ptx/instructions/clusterlaunchcontrol.h | 37 +++++++++++++++++++ libcudacxx/include/cuda/ptx | 1 + .../ptx.clusterlaunchcontrol.compile.pass.cpp | 22 +++++++++++ 4 files changed, 71 insertions(+) create mode 100644 docs/libcudacxx/ptx/instructions/clusterlaunchcontrol.rst create mode 100644 libcudacxx/include/cuda/__ptx/instructions/clusterlaunchcontrol.h create mode 100644 libcudacxx/test/libcudacxx/cuda/ptx/ptx.clusterlaunchcontrol.compile.pass.cpp diff --git a/docs/libcudacxx/ptx/instructions/clusterlaunchcontrol.rst b/docs/libcudacxx/ptx/instructions/clusterlaunchcontrol.rst new file mode 100644 index 00000000000..75fe44f6f22 --- /dev/null +++ b/docs/libcudacxx/ptx/instructions/clusterlaunchcontrol.rst @@ -0,0 +1,11 @@ +.. _libcudacxx-ptx-instructions-clusterlaunchcontrol: + +clusterlaunchcontrol +==================== + +- PTX ISA: + `clusterlaunchcontrol.try_cancel `__ +- PTX ISA: + `clusterlaunchcontrol.query_cancel `__ + +.. include:: generated/clusterlaunchcontrol.rst diff --git a/libcudacxx/include/cuda/__ptx/instructions/clusterlaunchcontrol.h b/libcudacxx/include/cuda/__ptx/instructions/clusterlaunchcontrol.h new file mode 100644 index 00000000000..b15cfddf4a0 --- /dev/null +++ b/libcudacxx/include/cuda/__ptx/instructions/clusterlaunchcontrol.h @@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of libcu++, the C++ Standard Library for your entire system, +// under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +// +//===----------------------------------------------------------------------===// + +#ifndef _CUDA_PTX_CLUSTERLAUNCHCONTROL_H_ +#define _CUDA_PTX_CLUSTERLAUNCHCONTROL_H_ + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +#include +#include +#include + +#include // __CUDA_MINIMUM_ARCH__ and friends + +_LIBCUDACXX_BEGIN_NAMESPACE_CUDA_PTX + +#include + +_LIBCUDACXX_END_NAMESPACE_CUDA_PTX + +#endif // _CUDA_PTX_CLUSTERLAUNCHCONTROL_H_ diff --git a/libcudacxx/include/cuda/ptx b/libcudacxx/include/cuda/ptx index 4798973df77..7087dd97d2a 100644 --- a/libcudacxx/include/cuda/ptx +++ b/libcudacxx/include/cuda/ptx @@ -70,6 +70,7 @@ */ #include +#include #include #include #include diff --git a/libcudacxx/test/libcudacxx/cuda/ptx/ptx.clusterlaunchcontrol.compile.pass.cpp b/libcudacxx/test/libcudacxx/cuda/ptx/ptx.clusterlaunchcontrol.compile.pass.cpp new file mode 100644 index 00000000000..212414c4535 --- /dev/null +++ b/libcudacxx/test/libcudacxx/cuda/ptx/ptx.clusterlaunchcontrol.compile.pass.cpp @@ -0,0 +1,22 @@ +//===----------------------------------------------------------------------===// +// +// Part of libcu++, the C++ Standard Library for your entire system, +// under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +// +//===----------------------------------------------------------------------===// +// UNSUPPORTED: libcpp-has-no-threads + +// + +#include +#include + +#include "generated/clusterlaunchcontrol.h" + +int main(int, char**) +{ + return 0; +} From 7cdf7cff77f914826245873ee9aa24630221dbd3 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Thu, 30 Jan 2025 11:13:21 +0100 Subject: [PATCH 2/2] docs fix --- docs/libcudacxx/ptx/instructions.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/libcudacxx/ptx/instructions.rst b/docs/libcudacxx/ptx/instructions.rst index f0776974eec..32db843c28d 100644 --- a/docs/libcudacxx/ptx/instructions.rst +++ b/docs/libcudacxx/ptx/instructions.rst @@ -7,6 +7,7 @@ PTX Instructions :maxdepth: 1 instructions/barrier_cluster + instructions/clusterlaunchcontrol instructions/cp_async_bulk instructions/cp_async_bulk_commit_group instructions/cp_async_bulk_wait_group