codekingpro/portable-devtools
114k
1/*
2 * NVIDIA_COPYRIGHT_BEGIN
3 *
4 * Copyright (c) 2010-2020, NVIDIA CORPORATION. All rights reserved.
5 *
6 * NVIDIA CORPORATION and its licensors retain all intellectual property
7 * and proprietary rights in and to this software, related documentation
8 * and any modifications thereto. Any use, reproduction, disclosure or
9 * distribution of this software and related documentation without an express
10 * license agreement from NVIDIA CORPORATION is strictly prohibited.
11 *
12 * NVIDIA_COPYRIGHT_END
13 */
14
15#ifndef fatbinary_section_INCLUDED
16#define fatbinary_section_INCLUDED
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/*
23 * These defines are for the fatbin.c runtime wrapper
24 */
25#define FATBINC_MAGIC 0x466243B1
26#define FATBINC_VERSION 1
27#define FATBINC_LINK_VERSION 2
28
29typedef struct {
30 int magic;
31 int version;
32 const unsigned long long* data;
33 void *filename_or_fatbins; /* version 1: offline filename,
34 * version 2: array of prelinked fatbins */
35} __fatBinC_Wrapper_t;
36
37/*
38 * The section that contains the fatbin control structure
39 */
40#ifdef STD_OS_Darwin
41/* mach-o sections limited to 15 chars, and want __ prefix else strip complains, * so use a different name */
42#define FATBIN_CONTROL_SECTION_NAME "__fatbin"
43#define FATBIN_DATA_SECTION_NAME "__nv_fatbin"
44/* only need segment name for mach-o */
45#define FATBIN_SEGMENT_NAME "__NV_CUDA"
46#else
47#define FATBIN_CONTROL_SECTION_NAME ".nvFatBinSegment"
48/*
49 * The section that contains the fatbin data itself
50 * (put in separate section so easy to find)
51 */
52#define FATBIN_DATA_SECTION_NAME ".nv_fatbin"
53#endif
54/* section for pre-linked relocatable fatbin data */
55#define FATBIN_PRELINK_DATA_SECTION_NAME "__nv_relfatbin"
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* fatbinary_section_INCLUDED */
62 