Project
Loading...
Searching...
No Matches
GPUGeneralKernels.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#include "GPUGeneralKernels.h"
16#include "GPUConstantMem.h"
17using namespace o2::gpu;
18
19template <>
20GPUdii() void GPUMemClean16::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUglobalref() void* ptr, uint64_t size)
21{
22 const uint64_t stride = get_global_size(0);
23 int4 i0;
24 i0.x = i0.y = i0.z = i0.w = 0;
25 int4* ptra = (int4*)ptr;
26 uint64_t len = (size + sizeof(int4) - 1) / sizeof(int4);
27 for (uint64_t i = get_global_id(0); i < len; i += stride) {
28 ptra[i] = i0;
29 }
30}
31
32template <>
33GPUdii() void GPUitoa::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUglobalref() int32_t* ptr, uint64_t size)
34{
35 const uint64_t stride = get_global_size(0);
36 for (uint64_t i = get_global_id(0); i < size; i += stride) {
37 ptr[i] = i;
38 }
39}
int32_t i
#define GPUsharedref()
#define get_global_size(dim)
#define GPUrestrict()
#define get_global_id(dim)
#define GPUglobalref()
GPUdii() void GPUMemClean16
TBranch * ptr
GLsizeiptr size
Definition glcorearb.h:659
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLint GLenum GLboolean GLsizei stride
Definition glcorearb.h:867
GLenum GLenum GLsizei len
Definition glcorearb.h:4232
int32_t y
int32_t z
int32_t x
int32_t w