コード例 #1
0
ファイル: CLContext.cpp プロジェクト: jholewinski/overtile
CLContext::CLContext() {
  cl_int         result;
  PlatformVector allPlatforms;

  result = cl::Platform::get(&allPlatforms);
  throwOnError("cl::Platform::get", result);

  if(allPlatforms.size() == 0) {
    throw std::runtime_error("No platforms available");
  }

  platform_ = allPlatforms[0];

  //printValue("Platform", platform_.getInfo<CL_PLATFORM_NAME>());

  // Create context
  cl_context_properties cps[3] = {
    CL_CONTEXT_PLATFORM,
    (cl_context_properties)(platform_)(),
    0
  };

  context_ = cl::Context(CL_DEVICE_TYPE_GPU, cps, NULL, NULL, &result);
  throwOnError("cl::Context", result);

  DeviceVector allDevices = context_.getInfo<CL_CONTEXT_DEVICES>();

  if(allDevices.size() == 0) {
    throw std::runtime_error("No devices available");
  }

  device_ = allDevices[0];

  //printValue("Device", device_.getInfo<CL_DEVICE_NAME>());
}
コード例 #2
0
ファイル: path.cpp プロジェクト: rmcgibbo/gromacs
void File::throwOnNotFound(const NotFoundInfo &info)
{
    throwOnError(info);
    const std::string message
        = formatString("File '%s' does not exist or is not accessible.\n%s",
                       info.filename, info.message);
    GMX_THROW_WITH_ERRNO(InvalidInputError(message), info.call, info.err);
}
コード例 #3
0
ファイル: DB.cpp プロジェクト: peholmst/JumpSeat
void JumpSeat::PreparedStatement::setDouble(const int index, const double value) {
    throwOnError(sqlite3_bind_double(stmt_, index, value),
            "error setting double");
}
コード例 #4
0
ファイル: DB.cpp プロジェクト: peholmst/JumpSeat
void JumpSeat::PreparedStatement::setInt(const int index, const int value) {
    throwOnError(sqlite3_bind_int(stmt_, index, value),
            "error setting int");
}
コード例 #5
0
ファイル: DB.cpp プロジェクト: peholmst/JumpSeat
void JumpSeat::PreparedStatement::setText(const int index, const std::string& value) {
    throwOnError(sqlite3_bind_text(stmt_, index, value.c_str(), -1, SQLITE_TRANSIENT),
            "error setting text");
}
コード例 #6
0
ファイル: DB.cpp プロジェクト: peholmst/JumpSeat
void JumpSeat::PreparedStatement::setNull(const int index) {
    throwOnError(sqlite3_bind_null(stmt_, index),
            "error setting null");
}
コード例 #7
0
ファイル: DB.cpp プロジェクト: peholmst/JumpSeat
void JumpSeat::PreparedStatement::reset() {
    throwOnError(sqlite3_reset(stmt_),
            "error reseting statement");
}
コード例 #8
0
ファイル: DB.cpp プロジェクト: peholmst/JumpSeat
JumpSeat::PreparedStatement::PreparedStatement(DB& db, const std::string& sql) {
    throwOnError(sqlite3_prepare_v2(db.db_, sql.c_str(), -1, &stmt_, NULL),
            "error preparing statement");
}
コード例 #9
0
ファイル: Context.cpp プロジェクト: RangelReale/ASECP
void Context::suspend()
{
	throwOnError(_context->Suspend());
}
コード例 #10
0
ファイル: Context.cpp プロジェクト: RangelReale/ASECP
void Context::abort()
{
	throwOnError(_context->Abort());
}
コード例 #11
0
ファイル: Context.cpp プロジェクト: RangelReale/ASECP
void Context::execute()
{
	throwOnError(_context->Execute());
}
コード例 #12
0
ファイル: Context.cpp プロジェクト: RangelReale/ASECP
void Context::prepare(Function::Ptr function)
{
	throwOnError(_context->Prepare(function->function()));
}