mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
clang-format: Apply formatting to HIP sources with .hip extension
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -60,6 +60,7 @@ coverage.xml.in tab-indent
|
||||
*.H our-c-style
|
||||
*.h our-c-style
|
||||
*.hh our-c-style
|
||||
*.hip our-c-style
|
||||
*.hpp our-c-style
|
||||
*.hxx our-c-style
|
||||
*.notcu our-c-style
|
||||
|
@@ -1,15 +1,14 @@
|
||||
#include <system_error>
|
||||
#include <type_traits>
|
||||
|
||||
#include <hip/hip_runtime_api.h>
|
||||
|
||||
static __global__ void fake_hip_kernel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int __host__ interface_hip_func(int x)
|
||||
{
|
||||
|
||||
fake_hip_kernel<<<1, 1>>>();
|
||||
bool valid = (hipSuccess == hipGetLastError());
|
||||
if (!valid) {
|
||||
|
@@ -1,15 +1,14 @@
|
||||
#include <system_error>
|
||||
#include <type_traits>
|
||||
|
||||
#include <hip/hip_runtime_api.h>
|
||||
|
||||
static __global__ void fake_hip_kernel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int __host__ interface_hip_func(int x)
|
||||
{
|
||||
|
||||
fake_hip_kernel<<<1, 1>>>();
|
||||
bool valid = (hipSuccess == hipGetLastError());
|
||||
if (!valid) {
|
||||
|
@@ -1,15 +1,15 @@
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <hip/hip_runtime.h>
|
||||
#include <hip/hip_fp16.h>
|
||||
#include <hip/hip_runtime.h>
|
||||
#include <math.h>
|
||||
|
||||
namespace {
|
||||
template <class T, class F>
|
||||
__global__ void global_entry_point(F f, T *out) {
|
||||
__global__ void global_entry_point(F f, T* out)
|
||||
{
|
||||
*out = f();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@ bool verify(F f, T expected)
|
||||
}
|
||||
bool result = true;
|
||||
hipLaunchKernelGGL(global_entry_point, 1, 1, 0, 0, f, gpu_T);
|
||||
result = hipMemcpy(cpu_T.get(), gpu_T, sizeof(T), hipMemcpyDeviceToHost) == hipSuccess && result;
|
||||
result = hipMemcpy(cpu_T.get(), gpu_T, sizeof(T), hipMemcpyDeviceToHost) ==
|
||||
hipSuccess &&
|
||||
result;
|
||||
result = hipFree(gpu_T) == hipSuccess && result;
|
||||
result = *cpu_T == expected && result;
|
||||
return result;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include <system_error>
|
||||
#include <type_traits>
|
||||
|
||||
#include <hip/hip_runtime_api.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -8,15 +9,12 @@
|
||||
# define EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
static __global__ void fake_hip_kernel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int __host__ shared_hip_func(int x)
|
||||
{
|
||||
|
||||
fake_hip_kernel<<<1, 1>>>();
|
||||
bool valid = (hipSuccess == hipGetLastError());
|
||||
if (!valid) {
|
||||
|
@@ -1,17 +1,14 @@
|
||||
|
||||
#include <type_traits>
|
||||
#include <system_error>
|
||||
#include <hip/hip_runtime_api.h>
|
||||
#include <type_traits>
|
||||
|
||||
#include <hip/hip_runtime_api.h>
|
||||
|
||||
static __global__ void fake_hip_kernel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int __host__ static_hip_func(int x)
|
||||
{
|
||||
|
||||
fake_hip_kernel<<<1, 1>>>();
|
||||
bool valid = (hipSuccess == hipGetLastError());
|
||||
if (!valid) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include <system_error>
|
||||
|
||||
#include <hip/hip_runtime_api.h>
|
||||
|
||||
static __global__ void fake_hip_kernel()
|
||||
@@ -7,7 +8,6 @@ static __global__ void fake_hip_kernel()
|
||||
|
||||
int __host__ try_compile_hip_func(int x)
|
||||
{
|
||||
|
||||
fake_hip_kernel<<<1, 1>>>();
|
||||
bool valid = (hipSuccess == hipGetLastError());
|
||||
if (!valid) {
|
||||
|
Reference in New Issue
Block a user