   { \
     if (prop.name[index] < (value)) { \
       THROW_ERROR( \
-          "CUDA Device " << dev_id_ << \
+          "CUDA Device " << device_id << \
           " does not satisfy the minimum requirement by primitiv: " \
           << "property: " << #name << "[" << #index << "], " \
           << "value: " << prop.name[index] << ", " \

  }

  ::cudaDeviceProp prop;
  CUDA_CALL(::cudaGetDeviceProperties(&prop, dev_id_));

  // Checks compute capability
  static const int MIN_CC_MAJOR = 3;
  static const int MIN_CC_MINOR = 0;
  if (prop.major < ::MIN_CC_MAJOR ||
      (prop.major == ::MIN_CC_MAJOR && prop.minor < ::MIN_CC_MINOR)) {
    THROW_ERROR(
        "CUDA Device " << dev_id_ << " does not satisfy the "
        "minimum requirement of the compute capability: "
        << prop.major << '.' << prop.minor << " < "
        << ::MIN_CC_MAJOR << '.' << ::MIN_CC_MINOR);
  }

  // Checks other requirements.

  }

  CHECK_REQUIREMENT(totalGlobalMem, 1ull * (1ull << 30));
  CHECK_REQUIREMENT(sharedMemPerBlock, 16ull * (1ull << 10));
  CHECK_REQUIREMENT(maxThreadsPerBlock, 1024);
  CHECK_REQUIREMENT_VECTOR(maxThreadsDim, 0, 1024);
  CHECK_REQUIREMENT_VECTOR(maxThreadsDim, 1, 1024);
  CHECK_REQUIREMENT_VECTOR(maxThreadsDim, 2, 64);
  CHECK_REQUIREMENT_VECTOR(maxGridSize, 0, 65535);
  CHECK_REQUIREMENT_VECTOR(maxGridSize, 1, 65535);
  CHECK_REQUIREMENT_VECTOR(maxGridSize, 2, 65535);
