c++intel-miccilk-plusxeon-phiicc

Intel C++ compiler gives "offload constructs are not supported on this platform" error


When compiling a basic code segment on windows (using visual studio) that uses the _Cilk_offload keyword, the compiler throws error : offload constructs are not supported on this platform on all lines with _Cilk_offload and _Cilk_shared (compiled with \Qoffload)

What specifically is the problem with the platform or setup?

EDIT: Code fails at compile time, and compile machine and target machine are different

Follows is the basic outline of my code

Main.cpp

//other includes
#include <cilk/cilk.h>
#include "offload.h"
#define ITERS 100

int main()
{
    // code ommitted
    doSetup();
    for(int i=0;i<ITERS;i++)
//initialize array    {
        doWork();
    }
    // code omitted
}

offload.h

#ifndef OFFLOAD_H
#define OFFLOAD_H

#define ARRAY_WIDTH 100
#define ARRAY_HEIGHT 100
#define ARRAY_SIZE ARRAY_WIDTH*ARRAY_HEIGHT

void doWork();
void doSetup();

#endif

offload.cpp

#include "offload.h"
#include <cilk/cilk.h>

_Cilk_shared float c=1.1;
_Cilk_shared float __declspec(align(64)) a[ARRAY_SIZE]
_Cilk_shared float __declspec(align(64)) b[ARRAY_SIZE]
void doWork()
{
    _Cilk_offload cilk_for(int j=0; j<ARRAY_HEIGHT; j++)
    {
        a[j*ARRAY_WIDTH:ARRAY_WIDTH] = c * a[j*ARRAY_WIDTH:ARRAY_WIDTH] + b[j*ARRAY_WIDTH:ARRAY_WIDTH];
    }
}

void doSetup()
{
    //array initialization omitted
}

Solution

  • Fixed the issue, there was several pieces of the compiler suite missing from the install directories. I updated parallel studio and the files were present. If you have an issue with this, see if the file named ofldbegin.obj and ofldend.obj exist in your system, under (installDirectory)\compiler\lib\intel64