Commit 5ba7bf6e authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Protect cluster.cpp inclusions with offload compiler flags

parent 3e71abbc
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -108,9 +108,13 @@
#include "../include/Commons.h"
#endif

#ifdef USE_TARGET_OFFLOAD
#ifdef USE_MAGMA
#ifndef INCLUDE_MAGMA_CALLS_H_
#include "../include/magma_calls.h"
#endif
#endif // INCLUDE_MAGMA_CALLS
#endif // USE_MAGMA
#endif // USE_TARGET_OFFLOAD

using namespace std;

@@ -162,7 +166,9 @@ void cluster(const string& config_file, const string& data_file, const string& o
  const magma_int_t d_array_max_size = 32; // TEMPORARY: can become configurable parameter
  magma_device_t *device_array = new magma_device_t[d_array_max_size];
  magma_int_t num_devices;
#ifdef USE_TARGET_OFFLOAD
  cudaDeviceSetLimit(cudaLimitStackSize, 4096);
#endif // USE TARGET_OFFLOAD
  magma_getdevices(device_array, d_array_max_size, &num_devices);
  device_count = (int)num_devices;
  delete[] device_array;