Ignore:
Timestamp:
Sep 29, 2017, 8:19:51 PM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Add new library: CLRXCLHelper that facilitate creating binary/program for OpenCL. Use CLRXCLHelper in samples.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/samples/CLUtils.h

    r3411 r3450  
    2525#include <vector>
    2626#include <exception>
     27#include <CLRX/clhelper/CLHelper.h>
    2728#include <CL/cl.h>
    28 
    29 /// error class based on std::exception
    30 class CLError: public std::exception
    31 {
    32 private:
    33     cl_int error;
    34     std::string description;
    35 public:
    36     /// empty constructor
    37     CLError() : error(0)
    38     { }
    39     explicit CLError(const char* _description) : error(0), description(_description)
    40     { }
    41     CLError(cl_int _error, const char* _description) : error(_error)
    42     {
    43         char buf[20];
    44         ::snprintf(buf, 20, "%d", _error);
    45         description = "Error code: ";
    46         description += buf;
    47         description += ", Desc: ";
    48         description += _description;
    49     }
    50     virtual ~CLError() noexcept
    51     { }
    52     const char* what() const noexcept
    53     { return (!description.empty()) ? description.c_str() : "No error!"; }
    54     int code() const
    55     { return error; }
    56 };
    5729
    5830class CLFacade
Note: See TracChangeset for help on using the changeset viewer.