Skip to content

Aparapi项目文档的自用简中翻译. Unofficial Chinese translation of Aparapi document.

Notifications You must be signed in to change notification settings

FirokOtaku/aparapi-document-zhcn

Repository files navigation

Aparapi 文档翻译

声明

知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 (中文)

  • 不允许 对本作品的全文或部分 直接复制粘贴再发布;
    如需再发布本作品请进行 有意义的 增删改.
    本作品很垃圾, 也请不要让垃圾一点不变味就到处传播

中文开发社区已经很拉了, 求求别让它更拉了
每次想找点资料都跟进了废品回收站一样

文档列表

翻译状态 说明
🕒 未开始
进行中
暂停
完成
原文 译文 翻译状态
Introduction 介绍
About 关于
Getting Started 起步
FAQ FAQ
Documentation 文档
Aparapi Patterns Aparapi 示例
Choosing Specific Devices 指定运行设备
Converting Java to OpenCL Java 和 OpenCL 之间的转换
Emulating Multiple Entrypoints 模拟多程序入口
Explicit Buffer Handling 手动管理缓冲区
HSA Enabled Lambda 🕒
Kernel Guidelines 内核编程指南
Library Agent Duality 库/代理二重性
New Features 新特性 🕒
OpenCL Bindings OpenCL 绑定
Private Memory Space 私有缓冲区
Profiling the Kernel 对内核进行性能分析
Setting Up HSA 🕒
Unit Tests 单元测试
Using HSA Simulator 使用 HSA 模拟器
Constant Memory 常量内存
Local Memory 本地内存
Multiple Dim Ranges 多维执行域 🕒
Proposals 建议
Multiple Dim ND Range 多维执行域 🕒
Lambdas 🕒
Address Space with Buffers 🕒
Extensions 🕒
Device 选择执行设备
Multiple Entry Points 多程序入口
Lambda Syntax 使用 Lambda 语法

译例

kernel - 内核

Aparapi 的代码都是围绕着 kernel 实例运行的.

暂时不确定有什么更好的译名.

range - 执行域

一层循环就是一维执行域, 二层循环就是二维执行域, 以此类推.

后面有个 "multiple-dim range" 其实就是多层循环.

为什么是 "执行域"?
不知道, 脑内词汇随机排列组合抖机灵

method and its reachable method - 方法和其可及方法

对于下面的代码, 对 funA() 来说其可及方法是 funB()funC()

void funA()
{
    funB();
    funC();
}
void funB() {}
void funC() {}
void funD() {}

entrypoint - 程序入口

class Human
{
    void goA() { println("go a"); }
    void goB() { println("go b"); }
    void goC() { println("go c"); }
}

上面的 Human 实例对外提供3个控制入口执行不同的过程.

Aparapi 对外提供的是下面这种形式的单程序入口, 用参数来控制内部执行过程:

class Human 
{
    void goWhere(int where)
    {
        switch(where)
        {
            case 1: println("go a"); break;
            case 2: println("go b"); break;
            case 3: println("go c"); break;
        }
        println("go "+where);
    }
}

详见 模拟多程序入口.

reduction function and reduction operation - 减项函数和减项操作

reduction function 作为 reduction operator, 用于执行 reduction operation.

WikipediaReduction Operator 的描述:
In computer science, the reduction operator is a type of operator that is commonly used in parallel programming to reduce the elements of an array into a single result.
Reduction operators are associative and often (but not necessarily) commutative.
The reduction of sets of elements is an integral part of programming models such as Map Reduce, where a reduction operator is applied (mapped) to all elements before they are reduced.
Other parallel algorithms use reduction operators as primary operations to solve more complex problems.
Many reduction operators can be used for broadcasting to distribute data to all processors.

reduction-operation 在 Java 中相关的接口为 java.util.stream.Stream#reduce.

commutative style function - 可交换式函数

Wikipedia 对于 "可交换式运算" 的描述:

  1. 在集合 S 的一二元运算 * 被称之为 "可交换" 的, 若:
    ∀x,y∈S,x∗y=y∗x 一个不满足上述性质的运算则称之为 "不可交换的".
  2. 若称 x* 下和 y "可交换", 即表示:
    x*y=y*x
  3. 一二元函数 f:A×A→B 被称之为 "可交换" 的, 若:
    ∀x,y∈A,f(x,y)=f(y,x).

对若干元素进行一个操作, 给定元素顺序不同不会影响最终结果, 这个操作就是可交换的.

比如求一堆数字里面的最大值, 无论这些数字/对数字求最大值的顺序如何, 都不会影响最终结果.

binding 绑定

在一个语言中实现了一套 API, 然后在另一个语言中提供了对这套 API 的完整封装, 这个封装一般叫 binding.

这里直译为 "绑定", 虽然总感觉怪怪的.

About

Aparapi项目文档的自用简中翻译. Unofficial Chinese translation of Aparapi document.

Resources

Stars

Watchers

Forks