forked from facebookarchive/fbcuda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputeCapabilities.cuh
More file actions
35 lines (30 loc) · 930 Bytes
/
ComputeCapabilities.cuh
File metadata and controls
35 lines (30 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <cuda.h>
/** @file
Compute capability specific defines that can be used as
compile-time constants.
warpSize for instance is not a compile-time constant, so it cannot
be used for loop unrolling and register assignment.
*/
#ifdef __CUDA_ARCH__
#if __CUDA_ARCH__ < 200
#define WARP_SIZE 32
#define LOG_WARP_SIZE 5
#define MAX_THREADS_PER_BLOCK 512
#elif __CUDA_ARCH__ <= 700
#define WARP_SIZE 32
#define LOG_WARP_SIZE 5
#define MAX_THREADS_PER_BLOCK 1024
#else
#error Unknown __CUDA_ARCH__; please define parameters
#endif // __CUDA_ARCH__ types
#endif // __CUDA_ARCH__
#ifndef __CUDA_ARCH__
// dummy value for host compiler
#define WARP_SIZE 32
#define LOG_WARP_SIZE 5
#define MAX_THREADS_PER_BLOCK 1024
#endif // !__CUDA_ARCH__
#define HALF_WARP_SIZE (WARP_SIZE / 2)
#define MAX_WARPS_PER_BLOCK (MAX_THREADS_PER_BLOCK / WARP_SIZE)