Skip to content

Commit b5a1276

Browse files
committed
Add MIT header to OpenMP file. Clean up
1 parent 477080c commit b5a1276

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

HIP/CPP/Atomics/fine_coarse_grain_worst_case.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ __global__ void atomicAdd_worse(float *a, float *out, int n)
3434
}
3535
}
3636

37-
// __global__ void vector_add_float(float *out, float *a, float *b, int n, float *flag)
38-
// {
39-
// size_t index = blockIdx.x * blockDim.x + threadIdx.x;
40-
// size_t stride = blockDim.x * gridDim.x;
41-
// float one = 1.0f;
42-
43-
// for (size_t i = index; i < n; i += stride)
44-
// out[i] = a[i] + b[i];
45-
46-
// atomicAdd(*flag , one);
47-
// }
48-
4937
void host_add(float *out, float *a, float *b, int n)
5038
{
5139
int i = 0;

HIP/CPP/Atomics/fine_coarse_grain_worst_case_int32.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ __global__ void atomicAdd_worse(int *a, int *out, int n)
3434
}
3535
}
3636

37-
// __global__ void vector_add_int(int *out, int *a, int *b, int n, int *flag)
38-
// {
39-
// size_t index = blockIdx.x * blockDim.x + threadIdx.x;
40-
// size_t stride = blockDim.x * gridDim.x;
41-
// int one = 1.0f;
42-
43-
// for (size_t i = index; i < n; i += stride)
44-
// out[i] = a[i] + b[i];
45-
46-
// atomicAdd(*flag , one);
47-
// }
48-
4937
void host_add(int *out, int *a, int *b, int n)
5038
{
5139
int i = 0;

OpenMP/CPP/simple_usm.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
// MIT License
2+
3+
// Copyright (c) 2022 Advanced Micro Devices, Inc.
4+
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
123
#include<cstdio>
224

325
#pragma omp requires unified_shared_memory

0 commit comments

Comments
 (0)