3.3. Release directiveΒΆ

The release directive asserts that a task will no longer perform accesses that conflict with the contents of the associated depend clause. The contents of the depend clause must be a subset of that of the task construct that is no longer referenced in the rest of the lifetime of the current task and its future subtasks. The release directive has not associated structured block.

The syntax of the release directive is the following:

#pragma oss release [clauses]

The valid clauses for the release directive are:

  • depend(<type>: <memory-reference-list>)
  • <depend-type>(<memory-reference-list>)

The following C code shows an example of partial release of the task dependences using the release directive:

#define SIZE 4096

float x[SIZE];
float y[SIZE];

int main() {

  #pragma oss task depend(out:x,y)
  {
     for (int i=0; i<SIZE; i++) x[i] = 0.0;
     #pragma oss release depend(out:x)

     for (int i=0; i<SIZE; i++) y[i] = 0.0;
  }
}