Content
1 syntax and semantic
2 example set
1 syntax and semantic
1.1 extending C
Peril-L notation stands on the shoulder of C.
1.2 parallel threads
forall(<intVar in (<index range specification>)){ <body> }
1.3 synchronized and coordination
(1) exclusive block
exclusive { <body> }
(2) barrier
近在forall中使用。
barrier
1.4 memory model
2 address spaces: global, local
全局内存存在并发读写、延迟(λ)。
全局-本地映射函数
(1) localize()
根据进程id,返回生成本地数据副本
(2) mysize(global, i)
返回进程Pi中数据的数量
(3) localToGlobal(localData, i, j)
返回Pi的局部数据中索引为i的数据相应的全局索引
1.5 synchronized memory
FE(full/empty)变量,必须是global数据,记法示例:
int t‘ = 0;
state\operation | read | write |
empty | stall(blocking) | => full |
full | => empty | stall(blocking) |
1.6 reduce and scan
Reduce(/)
Scan(\)
sample:
+/count // count is an array, return the sum of count‘s element min\items // item is an array, return the minimal of items‘ element
2 example set
时间: 2024-10-06 13:48:15