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 release clause must be a subset of the contents of the depend clause of the task, and the former will no longer be referenced for the remaining lifetime of the task and its future subtasks. The release directive does not have an associated structured block.

The syntax of the release directive is as follows:

#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 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;
  }
}

Warning

At this moment, the run-time system only supports releasing a dependency of the same dependency type that was specified at the task depend clause.