summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/nvgpu_gpuid.h
blob: 391d286e95681c4759ae8c1001c3673c841bce1b (plain) (blame)
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
/*
 * NVIDIA GPU ID functions, definitions.
 *
 * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */
#ifndef _NVGPU_GPUID_H_
#define _NVGPU_GPUID_H_

#define NVGPU_GPU_ARCHITECTURE_SHIFT 4

/* constructs unique and compact GPUID from nvgpu_gpu_characteristics
 * arch/impl fields */
#define NVGPU_GPUID(arch, impl) ((u32) ((arch) | (impl)))

#define NVGPU_GPUID_GK20A \
	NVGPU_GPUID(NVGPU_GPU_ARCH_GK100, NVGPU_GPU_IMPL_GK20A)

#define NVGPU_GPUID_GM20B \
	NVGPU_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM20B)

#endif /* _NVGPU_GPU_ID_H_ */