Files
TheRock/math-libs/libhipcxx/include/cuda/ptx
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

145 lines
6.2 KiB
C++

// -*- 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) 2023 NVIDIA CORPORATION & AFFILIATES.
//
//===----------------------------------------------------------------------===//
// MIT License
//
// Modifications Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#ifndef _CUDA_PTX
#define _CUDA_PTX
// NOTE(HIP/AMD): ptx is not supported on AMD hardware
#ifdef __HIP_PLATFORM_AMD__
#error ptx is not supported on AMD hardware and should not be included
#endif
#include <cuda/std/detail/__config>
#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
/*
* The cuda::ptx namespace intends to provide PTX wrappers for new hardware
* features and new PTX instructions so that they can be experimented with
* before higher-level C++ APIs are designed and developed.
*
* The wrappers have the following responsibilities:
*
* - They must prevent any PTX assembler errors, that is:
* - They are defined only for versions of the CUDA Toolkit in which nvcc/ptxas
* actually recognizes the instruction.
* - Sizes and types of parameters are correct.
* - They must convert state spaces correctly.
* - They adhere to the libcu++ coding standards of using:
* - Reserved identifiers for all parameters, variables. E.g. `__meow` or `_Woof`
* - _CUDA_VSTD:: namespace for types
*
* The wrappers should not do the following:
*
* - Use any non-native types. For example, an mbarrier instruction wrapper
* takes the barrier address as a uint64_t pointer.
*
* This header is intended for:
*
* - internal consumption by higher-level APIs such as cuda::barrier,
* - outside developers who want to experiment with the latest features of the
* hardware.
*
* Stability:
*
* - These headers are intended to present a stable API (not ABI) within one
* major version of the CTK. This means that:
* - All functions are marked inline
* - The type of a function parameter can be changed to be more generic if
* that means that code that called the original version can still be
* compiled.
*
* - Good exposure of the PTX should be high priority. If, at a new major
* version, we face a difficult choice between breaking backward-compatibility
* and an improvement of the PTX exposure, we will tend to the latter option
* more easily than in other parts of libcu++.
*
* Code organization:
*
* - Each instruction is in a separate file and is included below.
* - Some helper function and types can be found in ptx/ptx_helper_functions.h and ptx/ptx_dot_variants.h.
*/
#include <cuda/__ptx/instructions/barrier_cluster.h>
#include <cuda/__ptx/instructions/bfind.h>
#include <cuda/__ptx/instructions/bmsk.h>
#include <cuda/__ptx/instructions/clusterlaunchcontrol.h>
#include <cuda/__ptx/instructions/cp_async_bulk.h>
#include <cuda/__ptx/instructions/cp_async_bulk_commit_group.h>
#include <cuda/__ptx/instructions/cp_async_bulk_tensor.h>
#include <cuda/__ptx/instructions/cp_async_bulk_wait_group.h>
#include <cuda/__ptx/instructions/cp_async_mbarrier_arrive.h>
#include <cuda/__ptx/instructions/cp_reduce_async_bulk.h>
#include <cuda/__ptx/instructions/cp_reduce_async_bulk_tensor.h>
#include <cuda/__ptx/instructions/exit.h>
#include <cuda/__ptx/instructions/fence.h>
#include <cuda/__ptx/instructions/get_sreg.h>
#include <cuda/__ptx/instructions/getctarank.h>
#include <cuda/__ptx/instructions/ld.h>
#include <cuda/__ptx/instructions/mbarrier_arrive.h>
#include <cuda/__ptx/instructions/mbarrier_expect_tx.h>
#include <cuda/__ptx/instructions/mbarrier_init.h>
#include <cuda/__ptx/instructions/mbarrier_wait.h>
#include <cuda/__ptx/instructions/multimem_ld_reduce.h>
#include <cuda/__ptx/instructions/multimem_red.h>
#include <cuda/__ptx/instructions/multimem_st.h>
#include <cuda/__ptx/instructions/prmt.h>
#include <cuda/__ptx/instructions/red_async.h>
#include <cuda/__ptx/instructions/shfl_sync.h>
#include <cuda/__ptx/instructions/shl.h>
#include <cuda/__ptx/instructions/shr.h>
#include <cuda/__ptx/instructions/st.h>
#include <cuda/__ptx/instructions/st_async.h>
#include <cuda/__ptx/instructions/st_bulk.h>
#include <cuda/__ptx/instructions/tcgen05_alloc.h>
#include <cuda/__ptx/instructions/tcgen05_commit.h>
#include <cuda/__ptx/instructions/tcgen05_cp.h>
#include <cuda/__ptx/instructions/tcgen05_fence.h>
#include <cuda/__ptx/instructions/tcgen05_ld.h>
#include <cuda/__ptx/instructions/tcgen05_mma.h>
#include <cuda/__ptx/instructions/tcgen05_mma_ws.h>
#include <cuda/__ptx/instructions/tcgen05_shift.h>
#include <cuda/__ptx/instructions/tcgen05_st.h>
#include <cuda/__ptx/instructions/tcgen05_wait.h>
#include <cuda/__ptx/instructions/tensormap_cp_fenceproxy.h>
#include <cuda/__ptx/instructions/tensormap_replace.h>
#include <cuda/__ptx/instructions/trap.h>
#endif // _CUDA_PTX