acterhd
2016-07-19
I suggest directives like openmp.
- restrict atomics and multithreading
- read-only access from global space by default
- access to global function if support webmp
- special directives for open access to global variables (include atomics)
- special directives for get thread ids
function parallel(A, B, C){
"use webmp";
"webmp atomic";
let counter = 0;
"webmp read-write array"
C;
"webmp parallel for";
for(let i=0;i<512;i++){
"webmp threadId"
let threadID;
C[i] = A[i] + B[i];
}
}