玩转gpgpu-sim 04记—— __cudaRegisterBinary() of gpgpu-sim 到底做了什么

官方文档:

GPGPU-Sim 3.x Manual

__cudaRegisterBinary(void*) 被执行到的代码逻辑如下:

void** CUDARTAPI __cudaRegisterFatBinary( void *fatCubin )
{
#if (CUDART_VERSION < 2010)printf("GPGPU-Sim PTX: ERROR ** this version of GPGPU-Sim requires CUDA 2.1 or higher\n");exit(1);
#endifCUctx_st *context = GPGPUSim_Context();static unsigned next_fat_bin_handle = 1;if(context->get_device()->get_gpgpu()->get_config().use_cuobjdump()) {// The following workaround has only been verified on 64-bit systems. if (sizeof(void*) == 4) printf("GPGPU-Sim PTX: FatBin file name extraction has not been tested on 32-bit system.\n"); // FatBin handle from the .fatbin.c file (one of the intermediate files generated by NVCC)typedef struct {int m; int v; const unsigned long long* d; char* f;} __fatDeviceText __attribute__ ((aligned (8))); __fatDeviceText * fatDeviceText = (__fatDeviceText *) fatCubin;// Extract the source code file name that generate the given FatBin. // - Obtains the pointer to the actual fatbin structure from the FatBin handle (fatCubin).// - An integer inside the fatbin structure contains the relative offset to the source code file name.// - This offset differs among different CUDA and GCC versions. char * pfatbin = (char*) fatDeviceText->d; int offset = *((int*)(pfatbin+48)); char * filename = (pfatbin+16+offset); // The extracted file name is associated with a fat_cubin_handle passed// into cudaLaunch().  Inside cudaLaunch(), the associated file name is// used to find the PTX/SASS section from cuobjdump, which contains the// PTX/SASS code for the launched kernel function.  // This allows us to work around the fact that cuobjdump only outputs the// file name associated with each section. unsigned long long fat_cubin_handle = next_fat_bin_handle;next_fat_bin_handle++;printf("GPGPU-Sim PTX: __cudaRegisterFatBinary, fat_cubin_handle = %llu, filename=%s\n", fat_cubin_handle, filename);/*!* This function extracts all data from all files in first call* then for next calls, only returns the appropriate number*/assert(fat_cubin_handle >= 1);if (fat_cubin_handle==1) cuobjdumpInit();cuobjdumpRegisterFatBinary(fat_cubin_handle, filename);return (void**)fat_cubin_handle;}else{ ... }}

1. 调用关系

刚开始一波的调用关系如下:

代码方便索引,此处整理的整体关系为下面的函数调用上面首先定义的函数:

class gpgpu_functional_sim_config 
{	...int m_ptx_use_cuobjdump;...
}void gpgpu_functional_sim_config::reg_options(class OptionParser * opp)
{	...option_parser_register(opp, "-gpgpu_ptx_use_cuobjdump", OPT_BOOL,&m_ptx_use_cuobjdump,"Use cuobjdump to extract ptx and sass from binaries","1");//CUDART_VERSION >= 4000...
}gpgpu_sim *gpgpu_ptx_sim_init_perf()
{	...g_the_gpu_config.reg_options(opp);...
}class _cuda_device_id *GPGPUSim_Init()
{	...gpgpu_sim *the_gpu = gpgpu_ptx_sim_init_perf();the_gpu->set_prop(prop);the_device = new _cuda_device_id(the_gpu);start_sim_thread(1);...
}void** CUDARTAPI __cudaRegisterFatBinary( void *fatCubin )
{	...static CUctx_st* GPGPUSim_Context()class _cuda_device_id *GPGPUSim_Init()CUctx_st( _cuda_device_id *gpu ) { m_gpu = gpu; }//the_context = new CUctx_st(the_gpu);cuobjdumpInit();cuobjdumpRegisterFatBinary(fat_cubin_handle, filename);...
}

2. GPGPUSim_Context() 做了什么

3. 表示什么含义

GPGPUSim_Context()->get_device()->get_gpgpu()->get_config().use_cuobjdump() 表示什么含义

4. cuobjdumpInit() 做了什么

5. cuobjdumpRegisterFatBinary() 做了什么

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/145397.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

flink中不同序列化器性能对比

背景 flink有多种序列化方式&#xff0c;包括flink内置的以及fallback到kryo的&#xff0c;那么他们之间有多大的性能差距呢&#xff0c;本文就从https://flink.apache.org/2020/04/15/flink-serialization-tuning-vol.-1-choosing-your-serializer-if-you-can/这篇文章里摘录…

【微服务保护】

文章目录 Sentinel 微服务雪崩问题&#xff1a; 微服务中&#xff0c;服务间调用关系错综复杂&#xff0c;一个微服务往往依赖于多个其它微服务。服务D有 故障进而导致服务A有故障&#xff0c;进而导致服务雪崩。 解决雪崩问题的常见方式有四种&#xff1a; 超时处理&#xff1…

c# 中的类

反射 Activator.CreateInstance class Program {static void Main(string[] args){//反射Type t typeof(Student);object o Activator.CreateInstance(t, 1, "FJ");Student stu o as Student;Console.WriteLine(stu.Name);//动态编程dynamic stu2 Activator.Cre…

java生成PDF的Util

java使用itext生成pdf-CSDN博客 接上文 支持绘制表格 支持表格中的文本 字体加粗、字体上色、单元格背景上色&#xff0c; 支持拼接文本 支持单行文本 多种背景颜色、字体上色 支持自定义水印 废话不说先上效果图 工具类代码 package com.zxw.文件.PDF.util;import com.…

Stm32_标准库_5_呼吸灯_按键控制

Stm32按键和输出差不多 PA1为LED供给正电&#xff0c;PB5放置按键&#xff0c;按键一端接PB5,另一端接负极 void Key_Init(void){RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //APB2总线连接着GPIOBGPIO_InitStructur.GPIO_Mode GPIO_Mode_IPU;GPIO_InitStructur.…

Kafka:介绍和内部工作原理

展示Kafka工作方式的简单架构。 什么是Kafka&#xff1f;为什么我们要使用它&#xff1f;它是消息队列吗&#xff1f; •它是一个 分布式流处理平台或分布式 提交日志*。*•Kafka通常用于实时流数据管道&#xff0c;即在系统之间传输数据&#xff0c;构建不断流动的数据转换系统…

什么是GraphQL?它与传统的REST API有什么不同?

聚沙成塔每天进步一点点 ⭐ 专栏简介⭐ 什么是GraphQL&#xff1f;⭐ 与传统的REST API 的不同⭐ 写在最后 ⭐ 专栏简介 前端入门之旅&#xff1a;探索Web开发的奇妙世界 欢迎来到前端入门之旅&#xff01;感兴趣的可以订阅本专栏哦&#xff01;这个专栏是为那些对Web开发感兴趣…

Konva基本处理流程和相关架构设计

前言 canvas是使用JavaScript基于上下文对象进行2D图形的绘制的HTML元素&#xff0c;通常用于动画、游戏画面、数据可视化、图片编辑以及实时视频处理等方面。基于Canvas之上&#xff0c;诞生了例如 PIXI、ZRender、Fabric、Konva等 Canvas渲染引擎&#xff0c;兼顾易用的同时…

DataBinding双向绑定简介

一、简介 在Vue中使用的是MVVM架构。通过ViewModel可以实现M层和V层数据的双向绑定。Model层的数据发生变化后&#xff0c;会自动更新View层UI。UI层数据发生变化&#xff08;用户输入&#xff09;&#xff0c;可以驱动Model层的数据发生变化&#xff0c;借助于Vue框架中的View…

Spring cloud Sentinel介绍和安装

Sentinel介绍和安装 &#x1f308;初识Sentinel&#x1f308;安装Sentinel&#x1f320;docker 安装&#x1f320;下载sentinel镜像&#x1f320;启动sentinel镜像 &#x1f320;windows 安装&#x1f320;下载&#x1f320;运行 &#x1f320;sentinel访问 &#x1f308;微服务…

React 全栈体系(十四)

第七章 redux 六、react-redux 7. 代码 - react-redux 数据共享版 7.1 效果 7.2 App /* src/App.jsx */ import React, { Component } from "react"; import Count from "./containers/Count"; import Person from "./containers/Person";ex…

26947-2011 手动托盘搬运车 学习记录

声明 本文是学习GB-T 26947-2011 手动托盘搬运车. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 1 范围 本标准规定了手动托盘搬运车(以下简称托盘车)的结构参数、技术要求、试验方法、检验规则、 标志、包装、运输和贮存。 本标准适用于额定载荷…

【数据结构--八大排序】之冒泡排序+选择排序+插入排序

&#x1f490; &#x1f338; &#x1f337; &#x1f340; &#x1f339; &#x1f33b; &#x1f33a; &#x1f341; &#x1f343; &#x1f342; &#x1f33f; &#x1f344;&#x1f35d; &#x1f35b; &#x1f364; &#x1f4c3;个人主页 &#xff1a;阿然成长日记 …

2023彩虹全新SUP模板,知识付费模板,卡卡云模板

源码介绍&#xff1a; 2023彩虹全新SUP模板/知识付费模板/卡卡云模板&#xff0c;首页美化&#xff0c;登陆页美化&#xff0c;修复了pc端购物车页面显示不正常的问题。 请自行查毒。感觉彩虹不少源码可能都有不干净的东西 安装教程&#xff1a; 1.将这俩个数据库文件导入数据…

2023.09.30使用golang1.18编译Hel10-Web/Databasetools的windows版

#Go 1.21新增的 log/slog 完美解决了以上问题&#xff0c;并且带来了很多其他很实用的特性。 本次编译不使用log/slog 包 su - echo $GOPATH ;echo $GOROOT; cd /tmp; busybox wget --no-check-certificate https://go.dev/dl/go1.18.linux-amd64.tar.gz;\ which tar&&am…

Java on Azure Tooling 8月更新|以应用程序为中心的视图支持及 Azure 应用服务部署状态改进

作者&#xff1a;Jialuo Gan - Program Manager, Developer Division at Microsoft 排版&#xff1a;Alan Wang 大家好&#xff0c;欢迎阅读 Java on Azure 工具的八月更新。在本次更新中&#xff0c;我们将推出新的以应用程序为中心的视图支持&#xff0c;帮助开发人员在一个项…

Python计算巴氏距离

Python计算巴氏距离 巴氏距离简介 在统计中&#xff0c;巴氏距离&#xff08;Bhattacharyya Distance&#xff09;测量两个离散或连续概率分布的相似性。它与衡量两个统计样品或种群之间的重叠量的巴氏系数密切相关。巴氏距离和巴氏系数以20世纪30年代曾在印度统计研究所工作…

<Xcode> Xcode IOS无开发者账号打包和分发

关于flutter我们前边聊到的初入门、数据解析、适配、安卓打包、ios端的开发和黑苹果环境部署&#xff0c;但是对于苹果的打包和分发&#xff0c;我只是给大家了一个链接&#xff0c;作为一个顶级好男人&#xff0c;我认为这样是对大家的不负责任&#xff0c;那么这篇就主要是针…

解决WIFI网络登录困难的方法

当你遇到手机WIFI网络在连接成功后&#xff0c;总是提示网络受限或者当前网络无法连接互联网&#xff0c;但过一段时间后它又自动恢复正常的的问题&#xff0c;可以尝试用以下方法来解决。 第一步&#xff1a;打开WLAN连接设置界面&#xff0c;选择“更多设置” 第二步&#x…

分类预测 | MATLAB实现NGO-CNN北方苍鹰算法优化卷积神经网络数据分类预测

分类预测 | MATLAB实现NGO-CNN北方苍鹰算法优化卷积神经网络数据分类预测 目录 分类预测 | MATLAB实现NGO-CNN北方苍鹰算法优化卷积神经网络数据分类预测分类效果基本描述程序设计参考资料 分类效果 基本描述 1.Matlab实现NGO-CNN北方苍鹰算法优化卷积神经网络数据分类预测&…