-1

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
}
NathanFrasier
  • 196
  • 1
  • 13
  • So either switch to a platform that does support offloading, or stop trying to use it on your existing platform. Doesn't seem like much of a question... You likely can't force a platform that doesn't support something to suddenly start supporting it... – twalberg Jun 09 '14 at 16:13
  • It is on windows, which is listed as supported. – NathanFrasier Jun 09 '14 at 17:02
  • I think @twalberg mean: does your CPU support the Cilk extension? If there is no specific hw support in you Intel CPU there is no way this is going to work. – sergico Jun 09 '14 at 17:13
  • This fails at compile time, Cilk works for non-offload code, but offload code generation does not work. I should be able to compile regardless of the compiler side machines settings correct? – NathanFrasier Jun 09 '14 at 17:41

1 Answers1

0

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

NathanFrasier
  • 196
  • 1
  • 13