--- host/src/main.cpp 2018-02-12 17:54:56.000000000 +0000 +++ host/src/main.cpp 2018-07-20 19:36:03.824000000 +0000 @@ -59,6 +59,7 @@ static cl_kernel kernel1 = NULL; static cl_program program = NULL; static cl_int status = 0; +std::string hwtype = "hw"; // FFT operates with complex numbers - store them in a struct typedef struct { @@ -91,9 +92,6 @@ // Entry point. int main(int argc, char **argv) { - if(!init()) { - return false; - } int iterations = 2000; Options options(argc, argv); @@ -102,11 +100,16 @@ if(options.has("n")) { iterations = options.get("n"); } - + if(options.has("hw")) { + hwtype = options.get("hw"); + } if (iterations <= 0) { printf("ERROR: Invalid number of iterations\n\nUsage: %s [-N=<#>]\n\tN: number of iterations to run (default 2000)\n", argv[0]); return false; } +if(!init()) { + return false; + } // Allocate host memory #if USE_SVM_API == 0 @@ -160,7 +163,7 @@ d_inData = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(float2) * N * iterations, NULL, &status); checkError(status, "Failed to allocate input device buffer\n"); - d_outData = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_CHANNEL_2_INTELFPGA, sizeof(float2) * N * iterations, NULL, &status); + d_outData = clCreateBuffer(context, CL_MEM_READ_WRITE , sizeof(float2) * N * iterations, NULL, &status); checkError(status, "Failed to allocate output device buffer\n"); // Copy data from host to device @@ -333,7 +336,7 @@ } // Get the OpenCL platform. - platform = findPlatform("Intel(R) FPGA SDK for OpenCL(TM)"); + platform = findPlatform("Xilinx"); if(platform == NULL) { printf("ERROR: Unable to find Intel(R) FPGA OpenCL platform\n"); return false; @@ -360,8 +363,10 @@ // Create the program. - std::string binary_file = getBoardBinaryFile("fft1d", device); - printf("Using AOCX: %s\n\n", binary_file.c_str()); + std::string fname = "xclbin/fft1d."+ hwtype + "." + VERSION_STR; + printf("Looking for %s.\n",fname.c_str()); + std::string binary_file = getBoardBinaryFile(fname.c_str(), device); + printf("Using XCLBIN: %s\n\n", binary_file.c_str()); program = createProgramFromBinary(context, binary_file.c_str(), &device, 1); // Build the program that was just created.