[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,80 @@ +//===-- State.cpp - OpenMP State & ICV interface - C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/69806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,80 @@ +//===-- State.cpp - OpenMP State & ICV interface - C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,80 @@ +//===-- State.cpp - OpenMP State & ICV interface - C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,80 @@ +//===-- State.cpp - OpenMP State & ICV interface - C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
@@ -36,6 +46,15 @@ extern "C" { #pragma omp end declare variant #ifdef __AMDGCN__ +#pragma omp begin declare variant match( \ +device = {arch(amdgcn)}, \ +implementation

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -36,6 +46,15 @@ extern "C" { #pragma omp end declare variant #ifdef __AMDGCN__ +#pragma omp begin declare variant match( \ +device = {arch(amdgcn)}, \ +implementation

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: I figured we would just have an internal implementation of `malloc` provided by the OpenMP device runtime library. The variants make this more difficult, but we could just use `#ifdef __AMDGPU__` instead of an OpenMP variant so we can declare it as

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,80 @@ +//===-- State.cpp - OpenMP State & ICV interface - C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/69806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From f3e7e4008cc2acf9101721efd0b7c736b7d982c0 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From 70619108a402b01c5f1f9d307a8cf21289849d74 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
@@ -15,9 +15,19 @@ #endif #ifdef __cplusplus +#include jdoerfert wrote: this is not freestanding https://github.com/llvm/llvm-project/pull/69806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -15,9 +15,19 @@ #endif #ifdef __cplusplus +#include jhuber6 wrote: I'm unsure if there's ever a reason to include the C++ wrappers in a freestanding environment. Without C++, these go straight to the `clang` resource directly. With the C++ versions

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -48,25 +48,17 @@ namespace { extern "C" { [[gnu::weak, gnu::leaf]] void *malloc(uint64_t Size); [[gnu::weak, gnu::leaf]] void free(void *Ptr); -} -///} +void *llvm_device_malloc(uint64_t Size) { return allocator::alloc(Size); } +void llvm_device_free(void *Ptr) {

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Joseph Huber via cfe-commits
@@ -16,3 +16,4 @@ free memcmp printf __assert_fail +malloc jhuber6 wrote: This is already in the file https://github.com/llvm/llvm-project/pull/69806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From 50807ba3714b5556e9971f3f009fbd8bea70e15f Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 1cea309b7e2256746c72f3177e1a5b226bed4f83 d30ff2ef5df686c99184eec7caf175371694cd2d --

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From d0df9cbcb01528760c45898891e175f915dddbb1 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-openmp Author: Johannes Doerfert (jdoerfert) Changes The patch contains a basic BumpAllocator for (AMD)GPUs to allow us to run more tests. The allocator implements `malloc`, both internally and externally, while we continue to default to the NVIDIA

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert created https://github.com/llvm/llvm-project/pull/69806 The patch contains a basic BumpAllocator for (AMD)GPUs to allow us to run more tests. The allocator implements `malloc`, both internally and externally, while we continue to default to the NVIDIA `malloc`