Files
TheRock/rocm-systems/projects/rocprofiler-compute/sample/mega_kernel/atomic_global_buffers.h
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

34 lines
1.5 KiB
C

// Copyright (c) 2026 Advanced Micro Devices, Inc. All rights reserved.
// SPDX-License-Identifier: MIT
//
// Sizes and index layout for mega_kernel global atomic scratch buffers.
// main.cpp allocates and initializes; test_atomic_operations_asm / test_atomic_*
// in mega_kernel.hip must stay within these bounds.
#pragma once
// Element counts (device buffers sized with these in main.cpp).
#define MEGA_KERNEL_GLOBAL_INT_ELEMENTS 256
#define MEGA_KERNEL_GLOBAL_FLOAT_ELEMENTS 256
#define MEGA_KERNEL_GLOBAL_DOUBLE_ELEMENTS 64
// test_atomic_operations_asm (tid = global linear thread index):
// global_int_ptr: [tid % 64] — TEST 1 add / gfx12 asm add
// [(tid % 64) + 64] — TEST 1 max / gfx12 asm max
// [(tid % 64) + 128] — TEST 4 flat int add
// [(tid % 64) + 192] — TEST 10 CAS (expects initial 0)
// Max int index: 63 + 192 = 255 → need >= 256 int elements.
//
// global_f32_ptr: [tid % 64] — TEST 2 FP32 add
// [(tid % 64) + 64] — TEST 8 packed FP16
// [(tid % 64) + 128] — TEST 9 packed BF16
// Max float index: 63 + 128 = 191 → need >= 192 float elements (256 used).
//
// global_f64_ptr: [tid % 32], [(tid % 32) + 32] — TEST 3 (CDNA only)
// Max double index: 31 + 32 = 63 → need >= 64 double elements.
//
// Earlier in the same kernel launch (same buffers):
// test_atomic_add_f32: global_float[0]
// test_atomic_add_f64: global_double[0]
// test_atomic_int: global_int[0..6]