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
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
// RUN: %clangxx_tsan %s -o %t
|
|
// RUN: %run %t 2>&1 | FileCheck %s
|
|
|
|
#include <pthread.h>
|
|
#include <stdlib.h>
|
|
#include <stddef.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <time.h>
|
|
#include <sys/mman.h>
|
|
|
|
const long kSmallPage = 4 << 10;
|
|
const long kLargePage = 2 << 20;
|
|
const long kStride = 1 << 10;
|
|
|
|
typedef unsigned long uptr;
|
|
|
|
int main(int argc, const char **argv) {
|
|
uptr mem_size = 4 << 20;
|
|
if (argc > 1)
|
|
mem_size = (uptr)atoi(argv[1]) << 20;
|
|
uptr stride = kSmallPage;
|
|
if (argc > 2)
|
|
stride = (uptr)atoi(argv[2]) << 10;
|
|
int niter = 1;
|
|
if (argc > 3)
|
|
niter = atoi(argv[3]);
|
|
int stride2 = 1;
|
|
if (argc > 4)
|
|
stride2 = atoi(argv[4]);
|
|
|
|
uptr sz = mem_size + stride2 * kStride + kLargePage;
|
|
void *p = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
|
uptr a = ((uptr)p + kLargePage - 1) & ~(kLargePage - 1);
|
|
volatile char *mem = (volatile char *)a;
|
|
|
|
for (int i = 0; i < niter; i++) {
|
|
for (uptr off = 0; off < mem_size; off += stride) {
|
|
for (uptr off2 = 0; off2 < stride2; off2++)
|
|
mem[off + off2 * kStride] = 42;
|
|
}
|
|
}
|
|
|
|
fprintf(stderr, "DONE\n");
|
|
}
|
|
|
|
// CHECK: DONE
|
|
|