Fix some typos and incorrect namings in comments
This commit is contained in:
@@ -21,7 +21,7 @@ THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
* @file hcc_detail/hip_runtime.h
|
||||
*
|
||||
* @brief Contains definitions of APIs for HIP runtime.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@@ -286,71 +286,71 @@ __device__ inline unsigned long long int atomicXor(unsigned long long int* addre
|
||||
#ifdef __HCC__
|
||||
#include <hc.hpp>
|
||||
// integer intrinsic function __poc __clz __ffs __brev
|
||||
__device__ inline unsigned int __popc( unsigned int input)
|
||||
__device__ inline unsigned int __popc( unsigned int input)
|
||||
{
|
||||
return hc::__popcount_u32_b32( input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __popcll( unsigned long long int input)
|
||||
__device__ inline unsigned int __popcll( unsigned long long int input)
|
||||
{
|
||||
return hc::__popcount_u32_b64(input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __clz(unsigned int input)
|
||||
__device__ inline unsigned int __clz(unsigned int input)
|
||||
{
|
||||
return hc::__firstbit_u32_u32( input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __clzll(unsigned long long int input)
|
||||
__device__ inline unsigned int __clzll(unsigned long long int input)
|
||||
{
|
||||
return hc::__firstbit_u32_u64( input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __clz(int input)
|
||||
__device__ inline unsigned int __clz(int input)
|
||||
{
|
||||
return hc::__firstbit_u32_s32( input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __clzll(long long int input)
|
||||
__device__ inline unsigned int __clzll(long long int input)
|
||||
{
|
||||
return hc::__firstbit_u32_s64( input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __ffs(unsigned int input)
|
||||
__device__ inline unsigned int __ffs(unsigned int input)
|
||||
{
|
||||
return hc::__lastbit_u32_u32( input)+1;
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __ffsll(unsigned long long int input)
|
||||
__device__ inline unsigned int __ffsll(unsigned long long int input)
|
||||
{
|
||||
return hc::__lastbit_u32_u64( input)+1;
|
||||
}
|
||||
|
||||
__device__ inline unsigned int __brev( unsigned int input)
|
||||
__device__ inline unsigned int __brev( unsigned int input)
|
||||
{
|
||||
return hc::__bitrev_b32( input);
|
||||
}
|
||||
|
||||
__device__ inline unsigned long long int __brevll( unsigned long long int input)
|
||||
__device__ inline unsigned long long int __brevll( unsigned long long int input)
|
||||
{
|
||||
return hc::__bitrev_b64( input);
|
||||
}
|
||||
|
||||
// warp vote function __all __any __ballot
|
||||
|
||||
__device__ inline int __all( int input)
|
||||
__device__ inline int __all( int input)
|
||||
{
|
||||
return hc::__all( input);
|
||||
}
|
||||
|
||||
|
||||
__device__ inline int __any( int input)
|
||||
__device__ inline int __any( int input)
|
||||
{
|
||||
return hc::__any( input);
|
||||
}
|
||||
|
||||
|
||||
__device__ inline unsigned long long int __ballot( int input)
|
||||
__device__ inline unsigned long long int __ballot( int input)
|
||||
{
|
||||
return hc::__ballot( input);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ THE SOFTWARE.
|
||||
|
||||
/**
|
||||
* @file hcc_detail/hip_runtime_api.h
|
||||
* @brief Contains C function APIs for HIP runtime.
|
||||
* @brief Contains C function APIs for HIP runtime. This file does not use any HCC builtin or special language extensions (-hc mode) ; those functions in hip_runtime.h.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -35,12 +35,6 @@ THE SOFTWARE.
|
||||
#error("This version of HIP requires a newer version of HCC.");
|
||||
#endif
|
||||
|
||||
|
||||
// hip_api_hcc.h
|
||||
// Contains C function APIs for HIP runtime.
|
||||
// This file does not use any HCC builtin or special language extensions (-hc mode) ; those functions in hip_hcc.h.
|
||||
|
||||
|
||||
// Structure definitions:
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -604,7 +598,7 @@ hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop);
|
||||
*
|
||||
* Query the status of the specified event. This function will return #hipErrorNotReady if all commands
|
||||
* in the appropriate stream (specified to hipEventRecord) have completed. If that work has not completed,
|
||||
* or if hipEventRecord was not called on the event, then cudaSuccess is returned.
|
||||
* or if hipEventRecord was not called on the event, then hipSuccess is returned.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@@ -756,7 +750,7 @@ hipError_t hipMemGetInfo (size_t * free, size_t * total) ;
|
||||
* @param [in] peerDevice
|
||||
*
|
||||
* Returns "1" in @p canAccessPeer if the specified @p device is capable
|
||||
* of directly accessing memory phyically located on peerDevice , or "0" if not.
|
||||
* of directly accessing memory physically located on peerDevice , or "0" if not.
|
||||
*/
|
||||
hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int device, int peerDevice );
|
||||
|
||||
@@ -786,13 +780,13 @@ hipError_t hipMemcpyPeerAsync ( void* dst, int dstDevice, const void* src, int
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Returns the approximate HIP driver versin.
|
||||
* @brief Returns the approximate HIP driver version.
|
||||
*
|
||||
* @warning The HIP feature set does not correpond to an exact CUDA SDK driver revision.
|
||||
* @warning The HIP feature set does not correspond to an exact CUDA SDK driver revision.
|
||||
* This function always set *driverVersion to 4 as an approximation though HIP supports
|
||||
* some features which were introduced in later CUDA SDK revisions.
|
||||
* HIP apps code should not rely on the driver revision number here and should
|
||||
* use arch feature flags to test device capabiliies or conditional compilation.
|
||||
* use arch feature flags to test device capabilities or conditional compilation.
|
||||
*
|
||||
*/
|
||||
hipError_t hipDriverGetVersion(int *driverVersion) ;
|
||||
@@ -851,12 +845,12 @@ hipError_t hipDriverGetVersion(int *driverVersion) ;
|
||||
#ifdef __HCC__
|
||||
#include <hc.hpp>
|
||||
/**
|
||||
* @brief Return hc::acclerator associated with the specified deviceId
|
||||
* @brief Return hc::accelerator associated with the specified deviceId
|
||||
*/
|
||||
hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator *acc);
|
||||
|
||||
/**
|
||||
* @brief Return hc::acclerator_view associated with the specified stream
|
||||
* @brief Return hc::accelerator_view associated with the specified stream
|
||||
*/
|
||||
hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view **av);
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@ THE SOFTWARE.
|
||||
/**
|
||||
* @file hip_runtime_api.h
|
||||
*
|
||||
* Defines the API signatures for HIP runtime.
|
||||
* @brief Defines the API signatures for HIP runtime.
|
||||
* This file can be compiled with a standard compiler.
|
||||
*/
|
||||
|
||||
@@ -48,8 +48,8 @@ typedef struct {
|
||||
unsigned hasDoubles : 1; ///< double-precision floating point.
|
||||
|
||||
// Warp cross-lane operations:
|
||||
unsigned hasWarpVote : 1; ///< warp vote instructions (__any, __all)
|
||||
unsigned hasWarpBallot : 1; ///< warp ballot instructions (__ballot)
|
||||
unsigned hasWarpVote : 1; ///< warp vote instructions (__any, __all)
|
||||
unsigned hasWarpBallot : 1; ///< warp ballot instructions (__ballot)
|
||||
unsigned hasWarpShuffle : 1; ///< warp shuffle operations. (__shfl_*)
|
||||
unsigned hasFunnelShift : 1; ///< funnel two words into one, with shift&mask caps
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef struct {
|
||||
// Misc
|
||||
unsigned hasSurfaceFuncs : 1; ///< Surface functions
|
||||
unsigned has3dGrid : 1; ///< Grid and group dims are 3D (rather than 2D)
|
||||
unsigned hasDynamicParallelism : 1; ///< Dynamic parallellism
|
||||
unsigned hasDynamicParallelism : 1; ///< Dynamic parallelism
|
||||
} hipDeviceArch_t;
|
||||
|
||||
|
||||
@@ -68,16 +68,16 @@ typedef struct {
|
||||
// Common headers for both NVCC and HCC paths:
|
||||
|
||||
/**
|
||||
* hipDeviceProp
|
||||
* hipDeviceProp
|
||||
*
|
||||
*/
|
||||
typedef struct hipDeviceProp_t {
|
||||
char name[256]; ///< Device name
|
||||
size_t totalGlobalMem; ///< Size of global memory region (in bytes)
|
||||
size_t sharedMemPerBlock; ///< Size of shared memory region (in bytes)
|
||||
int regsPerBlock ; ///< registers per block
|
||||
int warpSize ; ///< warp size
|
||||
int maxThreadsPerBlock; ///< max work items per work group or workgroup max size
|
||||
int regsPerBlock ; ///< registers per block
|
||||
int warpSize ; ///< warp size
|
||||
int maxThreadsPerBlock; ///< max work items per work group or workgroup max size
|
||||
int maxThreadsDim[3]; ///< max number of threads in each dimension (XYZ) of a block
|
||||
int maxGridSize[3]; ///< max grid dimensions (XYZ)
|
||||
int clockRate ; ///< max clock frequency of the multiProcessors, in khz.
|
||||
@@ -89,7 +89,7 @@ typedef struct hipDeviceProp_t {
|
||||
int l2CacheSize; ///< L2 cache size
|
||||
int maxThreadsPerMultiProcessor; ///< Maximum resident threads per multi-processor
|
||||
int computeMode; ///< Compute mode
|
||||
|
||||
|
||||
int clockInstructionRate ; ///< Frequency in khz of the timer used by the device-side "clock*" instructions. New for HIP.
|
||||
|
||||
hipDeviceArch_t arch; ///< Architectural feature flags. New for HIP.
|
||||
@@ -97,10 +97,10 @@ typedef struct hipDeviceProp_t {
|
||||
|
||||
|
||||
// hack to get these to show up in Doxygen:
|
||||
/**
|
||||
/**
|
||||
* @defgroup GlobalDefs Global enum and defines
|
||||
* @{
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -115,10 +115,10 @@ typedef enum hipError_t {
|
||||
,hipErrorMemoryFree ///< Memory free error.
|
||||
,hipErrorUnknownSymbol ///< Unknown symbol
|
||||
,hipErrorOutOfResources ///< Out of resources error
|
||||
,hipErrorInvalidValue ///< One or more of the paramters passed to the API call is NULL or not in an acceptable range.
|
||||
,hipErrorInvalidValue ///< One or more of the parameters passed to the API call is NULL or not in an acceptable range.
|
||||
,hipErrorInvalidResourceHandle ///< Resource handle (hipEvent_t or hipStream_t) invalid.
|
||||
,hipErrorInvalidDevice ///< DeviceID must be in range 0...#compute-devices.
|
||||
,hipErrorNoDevice ///< Call to cudaGetDeviceCount returned 0 devices
|
||||
,hipErrorNoDevice ///< Call to hipGetDeviceCount returned 0 devices
|
||||
,hipErrorNotReady ///< indicates that asynchronous operations enqueued earlier are not ready. This is not actually an error, but is used to distinguish from hipSuccess (which indicates completion). APIs that return this error include hipEventQuery and hipStreamQuery.
|
||||
|
||||
,hipErrorUnknown ///< Unknown error
|
||||
@@ -135,7 +135,7 @@ typedef enum hipError_t {
|
||||
#include "hcc_detail/hip_runtime_api.h"
|
||||
#elif defined(__HIP_PLATFORM_NVCC__) and not defined (__HIP_PLATFORM_HCC__)
|
||||
#include "nvcc_detail/hip_runtime_api.h"
|
||||
#else
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__");
|
||||
#endif
|
||||
|
||||
|
||||
مرجع در شماره جدید
Block a user