<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>iris</title>
        <link>https://blog.ginshio.org/</link>
        <description>iris | GinShio 的个人博客</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>ginshio78@gmail.com (GinShio)</managingEditor>
            <webMaster>ginshio78@gmail.com (GinShio)</webMaster><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Sun, 01 Jun 2025 13:53:12 &#43;0800</lastBuildDate>
            <atom:link href="https://blog.ginshio.org/index.xml" rel="self" type="application/rss+xml" />
        <item>
    <title>Git Configurations</title>
    <link>https://blog.ginshio.org/2025/git_configurations/</link>
    <pubDate>Sun, 01 Jun 2025 13:53:12 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2025/git_configurations/</guid>
    <description><![CDATA[<p>使用 git 时不止要为 git 的复杂性头疼，还需要为 git 的配置文件头疼。当然这一切的来源都是多用户配置的需求：我需要多账户设置，比如个人账户和组织账户，但它们都是
github 账号。</p>]]></description>
</item><item>
    <title>GPU 基础介绍</title>
    <link>https://blog.ginshio.org/2024/gpu-introduce/</link>
    <pubDate>Fri, 15 Nov 2024 22:20:00 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2024/gpu-introduce/</guid>
    <description><![CDATA[<p>该篇介绍主要以 AMDGPU 7900XTX (Navi31) 为例。</p>
<h2 id="gpgpu-模型简介" class="headerLink">
    <a href="#gpgpu-%e6%a8%a1%e5%9e%8b%e7%ae%80%e4%bb%8b" class="header-mark"></a>GPGPU 模型简介</h2><figure><img src="/images/AMDGPU_RDNA3_HW_BlockDiagram.png">
</figure>

<h3 id="simt-模型" class="headerLink">
    <a href="#simt-%e6%a8%a1%e5%9e%8b" class="header-mark"></a>SIMT 模型</h3><p>现代 GPU 上基本使用 <strong>SIMT</strong> (单指令多线程, Single Instruction Multiple Threads) 模型，即一条指令执行在多个线程 (thread / lane / invocation) 上，每个线程上可能存储、运算不同地数据，也就是说具有大规模<strong>并行</strong>计算的能力。</p>]]></description>
</item><item>
    <title>How To Use Mesa&#39;s test tool: deqp-runner</title>
    <link>https://blog.ginshio.org/2024/how-to-use-deqp-runner/</link>
    <pubDate>Fri, 20 Sep 2024 23:13:27 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2024/how-to-use-deqp-runner/</guid>
    <description><![CDATA[<p><a href="https://gitlab.freedesktop.org/mesa/deqp-runner" target="_blank" rel="noopener noreferrer">deqp-runner</a> is a series of tools written by mesa developers for running vulkan
and opengl quality test case programs. It can run in parallel and robustly <a href="https://github.com/KhronosGroup/VK-GL-CTS" target="_blank" rel="noopener noreferrer">dEQP</a>
(draw-element quality program), <a href="https://gitlab.freedesktop.org/mesa/piglit" target="_blank" rel="noopener noreferrer">piglit</a>, SkQP (Skia Quality Program), and so on.</p>
<p>In my experience, when running large dEQP test cases, your own changes may cause
umd (user mode driver) to <em>fail</em>, <em>crash</em>, <em>timeout</em>, or <em>hang</em>. If you simply use
<code>deqp-vk</code>, the khronos testcases program for vulkan, the test will stop when umd
throws unrecoverable error. And we cannot easily get the results that new
failures based on the previous version.</p>]]></description>
</item><item>
    <title>How To Build Mesa for AMD</title>
    <link>https://blog.ginshio.org/2023/how-to-build-mesa/</link>
    <pubDate>Mon, 28 Aug 2023 22:25:22 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2023/how-to-build-mesa/</guid>
    <description><![CDATA[<h2 id="what" class="headerLink">
    <a href="#what" class="header-mark"></a>What</h2><p>copy from <a href="https://en.wikipedia.org/wiki/Mesa_%28computer_graphics%29" target="_blank" rel="noopener noreferrer">Wikipidia</a>:</p>
<p>Mesa is an open source implementation of OpenGL, Vulkan, and other graphics API
specifications. Mesa translates these specifications to vendor-specific graphics
hardware drivers.</p>
<h3 id="vendor-drivers" class="headerLink">
    <a href="#vendor-drivers" class="header-mark"></a>Vendor Drivers</h3><p>Mesa is UMD (User mode driver), provides implementation of graphics API and
shader compiler. Mesa is like a mono repository, different vendor drivers and
graphics APIs are in different directories.</p>
<p><strong>Gallium</strong> is a driver project in mesa, includes many backends for hardwares:</p>
<ul>
<li>AMD driver for GCN &amp; Navi (<em>radeonsi</em>)</li>
<li>Intel driver for iris (<em>i965</em>)</li>
<li>Intel driver (<em>i915</em>)</li>
<li>Nvidia driver (<em>nouveau</em>)</li>
<li>Software implementation (<em>swrast</em>)</li>
<li>OpenGL over Vulkan (<em>zink</em>)</li>
<li>DirectX3D 12 driver (<em>d3d12</em>)</li>
<li>OpenCL frontend (<em>clover</em>)</li>
<li>new OpenCL frontend by rust (<em>rusticl</em>, 23.1)</li>
</ul>
<p>libgl only provides APIs, and dispatch call to vendor implementation (e.g.
radeonsi).</p>]]></description>
</item><item>
    <title>数据抽象</title>
    <link>https://blog.ginshio.org/2023/cs61a_03_data_abstractions/</link>
    <pubDate>Sun, 12 Feb 2023 14:41:28 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2023/cs61a_03_data_abstractions/</guid>
    <description><![CDATA[<h2 id="容器" class="headerLink">
    <a href="#%e5%ae%b9%e5%99%a8" class="header-mark"></a>容器</h2><h3 id="lists" class="headerLink">
    <a href="#lists" class="header-mark"></a>Lists</h3><p>在 scheme 中一类最基础的异构数据结构即 <strong>list</strong></p>
<div class="code-block highlight is-open show-line-numbers  tw-group tw-my-2">
  <div class="
    tw-hidden
    tw-flex
    tw-flex-row
    tw-flex-1
    tw-justify-between
    tw-w-full tw-bg-bgColor-secondary
    ">
    <button
      class="
        code-block-button
        tw-mx-2
        tw-flex
        tw-flex-row
        tw-flex-1"
      aria-hidden="true">
          <div class="group-[.is-open]:tw-rotate-90 tw-transition-[transform] tw-duration-500 tw-ease-in-out print:!tw-hidden tw-w-min tw-h-min tw-my-1 tw-mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></div>
          <p class="tw-select-none !tw-my-1">scheme</p>]]></description>
</item><item>
    <title>libarchive 介绍与入门</title>
    <link>https://blog.ginshio.org/2023/libarchive_development_001/</link>
    <pubDate>Sat, 28 Jan 2023 19:09:45 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2023/libarchive_development_001/</guid>
    <description><![CDATA[<p>libarchive 是一个可以创建和读取多种不同流式归档格式的程序库，包含了最流行的 tar
格式变体、一些 cpio 格式，以及所有的 BSD 和 GNU ar 变体。bsdtar 是一个使用
libarchive 的 tar 实现。</p>]]></description>
</item><item>
    <title>图结构</title>
    <link>https://blog.ginshio.org/2022/data_strucures_and_algorithm_analysis_008_graph/</link>
    <pubDate>Fri, 07 Oct 2022 20:15:29 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2022/data_strucures_and_algorithm_analysis_008_graph/</guid>
    <description><![CDATA[<blockquote>
  <p>Graphs stand or fall by their choice of nodes and edges.</p>
<p>&mdash; Watts &amp; Strogatz</p>

</blockquote><div class="details admonition info open">
    <div class="details-summary admonition-title">
        <span class="icon"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/></svg></span>信息<span class="details-icon"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"/></svg></span>
    </div>
    <div class="details-content">
        <div class="admonition-content">对于图的学习推荐使用 <a href="https://apps.kde.org/rocs" target="_blank" rel="noopener noreferrer">Rocs</a>。什么？你说你是 Windows？那也不知道用什么啊，欢迎推荐其他工具。另外，KDE 天下第一！</div></div></div>
<h2 id="图的定义与表示" class="headerLink">
    <a href="#%e5%9b%be%e7%9a%84%e5%ae%9a%e4%b9%89%e4%b8%8e%e8%a1%a8%e7%a4%ba" class="header-mark"></a>图的定义与表示</h2><p>图 (graph) 是有序对 \(G = (V, E)\)，其中 V 是点集 (Vertex)，点的个数用
\(\lvert{V}\rvert\) 表示；\(E \subseteq \{ \{ x, y \}: (x, y) \in V^{2}, x \ne y \}\) 是边集
(Edge)，边的个数用 \(\lvert{E}\rvert\) 表示。如果点对是有序的，那么这个图称为有向图 (directed graph / digraph)。当然有向图的边，如果去掉方向限制所对应的无向图，称为该有向图的基础图 (underlying graph)。有时边还有一个属性称为权重 (weight)，表示使用这条边的代价 (cost)。如果任意两个顶点之间都有一条边的话，那么这个图被称作完全图 (complete graph)。</p>]]></description>
</item><item>
    <title>控制流、递归、高阶函数</title>
    <link>https://blog.ginshio.org/2022/cs61a_02_control_and_higher_order_functions/</link>
    <pubDate>Sun, 25 Sep 2022 14:26:28 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2022/cs61a_02_control_and_higher_order_functions/</guid>
    <description><![CDATA[<h2 id="控制流" class="headerLink">
    <a href="#%e6%8e%a7%e5%88%b6%e6%b5%81" class="header-mark"></a>控制流</h2><p>解释器所执行语句来执行某些操作。</p>
<figure><img src="/images/cs61a-compound-statements.png" width="64%">
</figure>

<p>比如这整个复合语句 (compound statement)，在 Python 中由 <code>def</code> 声明；标头 <code>header</code> 确定了一个简易语句 (clause) 的类型，这个语句中跟随了一个语句序列 (suite)。解释器会按一定顺序执行这个语句序列。</p>]]></description>
</item><item>
    <title>优化简介</title>
    <link>https://blog.ginshio.org/2022/introduction_to_optimization/</link>
    <pubDate>Fri, 23 Sep 2022 17:06:56 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2022/introduction_to_optimization/</guid>
    <description><![CDATA[<h2 id="优化背景" class="headerLink">
    <a href="#%e4%bc%98%e5%8c%96%e8%83%8c%e6%99%af" class="header-mark"></a>优化背景</h2><p>上世纪 80 年代早期优化在编译器开发中还是一个可选特性，一般在其他部分都完成后才会添加到编译器中。因此出现了<strong>调试编译器</strong>和<strong>优化编译器</strong>的区别，即前者强调编译速度，因此可执行代码与源码之间存在较强的对应关系；后者强调最小化或最大化可执行程序的某些属性。因此优化编译器会花费更多时间来编译，生成质量更好的代码，通常这个过程伴随着大量移动操作，使调试变得困难。</p>]]></description>
</item><item>
    <title>中间表示</title>
    <link>https://blog.ginshio.org/2022/intermediate_representation/</link>
    <pubDate>Mon, 19 Sep 2022 15:59:40 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2022/intermediate_representation/</guid>
    <description><![CDATA[<p>编译器通常组织为一连串的处理 pass，在每两个 pass 之间需要将已知的所有信息进行传递，因此编译器需要<strong>中间表示</strong> (IR, Intermediate Representation) 表达信息。IR 在编译器中可能是唯一的，也可能有多种。在转换期间，编译器不会回头查看源代码，而是只观察
IR，因此 IR 的性质对编译器对代码的处理由决定性影响。</p>]]></description>
</item><item>
    <title>CS61A 入门</title>
    <link>https://blog.ginshio.org/2022/cs61a_01_getting_started/</link>
    <pubDate>Sun, 18 Sep 2022 22:03:30 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2022/cs61a_01_getting_started/</guid>
    <description><![CDATA[<p>虽然 CS61A 使用 Python 进行教学，但我希望好好学一下 Erlang 和 Scheme。如果想查看更多关于 CS61A 的信息，请访问 <a href="https://cs61a.org/" target="_blank" rel="noopener noreferrer">课程主页</a>，当然我也会将一部分内容和实现放在自己的
<a href="https://gitlab.com/GinShio/sicp-learn.git" target="_blank" rel="noopener noreferrer">repo</a> 中。</p>]]></description>
</item><item>
    <title>内存对齐</title>
    <link>https://blog.ginshio.org/2022/memory_alignment/</link>
    <pubDate>Sat, 03 Sep 2022 17:41:38 &#43;0800</pubDate><author>
                    <name>GinShio</name>
                </author><guid>https://blog.ginshio.org/2022/memory_alignment/</guid>
    <description><![CDATA[<p>众所周知，运行的程序是需要内存占用的，在编码时假定栈上的空间是连续的，且定义的所有变量都连续分布在栈上。</p>
<p>实际上，虽然变量是连续分布在栈上的，但编译器会根据不同类型与对齐方式，将变量重新排列，达到最优情况。</p>]]></description>
</item></channel>
</rss>
