Skip to content

Commit ca7518c

Browse files
committed
Merge pull request opencv#19572 from diablodale:fix19571_ocl_noexcept
2 parents 54d80d9 + 77e26a7 commit ca7518c

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

modules/core/include/opencv2/core/ocl.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CV_EXPORTS Image2D;
7070
class CV_EXPORTS_W_SIMPLE Device
7171
{
7272
public:
73-
CV_WRAP Device();
73+
CV_WRAP Device() CV_NOEXCEPT;
7474
explicit Device(void* d);
7575
Device(const Device& d);
7676
Device& operator = (const Device& d);
@@ -245,7 +245,7 @@ class CV_EXPORTS_W_SIMPLE Device
245245
class CV_EXPORTS Context
246246
{
247247
public:
248-
Context();
248+
Context() CV_NOEXCEPT;
249249
explicit Context(int dtype); //!< @deprecated
250250
~Context();
251251
Context(const Context& c);
@@ -298,7 +298,7 @@ class CV_EXPORTS Context
298298
class CV_EXPORTS Platform
299299
{
300300
public:
301-
Platform();
301+
Platform() CV_NOEXCEPT;
302302
~Platform();
303303
Platform(const Platform& p);
304304
Platform& operator = (const Platform& p);
@@ -357,7 +357,7 @@ void initializeContextFromHandle(Context& ctx, void* platform, void* context, vo
357357
class CV_EXPORTS Queue
358358
{
359359
public:
360-
Queue();
360+
Queue() CV_NOEXCEPT;
361361
explicit Queue(const Context& c, const Device& d=Device());
362362
~Queue();
363363
Queue(const Queue& q);
@@ -421,7 +421,7 @@ class CV_EXPORTS KernelArg
421421
class CV_EXPORTS Kernel
422422
{
423423
public:
424-
Kernel();
424+
Kernel() CV_NOEXCEPT;
425425
Kernel(const char* kname, const Program& prog);
426426
Kernel(const char* kname, const ProgramSource& prog,
427427
const String& buildopts = String(), String* errmsg=0);
@@ -498,7 +498,7 @@ class CV_EXPORTS Kernel
498498
class CV_EXPORTS Program
499499
{
500500
public:
501-
Program();
501+
Program() CV_NOEXCEPT;
502502
Program(const ProgramSource& src,
503503
const String& buildflags, String& errmsg);
504504
Program(const Program& prog);
@@ -544,7 +544,7 @@ class CV_EXPORTS ProgramSource
544544
public:
545545
typedef uint64 hash_t; // deprecated
546546

547-
ProgramSource();
547+
ProgramSource() CV_NOEXCEPT;
548548
explicit ProgramSource(const String& module, const String& name, const String& codeStr, const String& codeHash);
549549
explicit ProgramSource(const String& prog); // deprecated
550550
explicit ProgramSource(const char* prog); // deprecated
@@ -614,7 +614,7 @@ class CV_EXPORTS ProgramSource
614614
class CV_EXPORTS PlatformInfo
615615
{
616616
public:
617-
PlatformInfo();
617+
PlatformInfo() CV_NOEXCEPT;
618618
/**
619619
* @param id pointer cl_platform_id (cl_platform_id*)
620620
*/

modules/core/src/ocl.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ struct Platform::Impl
14511451
bool initialized;
14521452
};
14531453

1454-
Platform::Platform()
1454+
Platform::Platform() CV_NOEXCEPT
14551455
{
14561456
p = 0;
14571457
}
@@ -1677,7 +1677,7 @@ struct Device::Impl
16771677
};
16781678

16791679

1680-
Device::Device()
1680+
Device::Device() CV_NOEXCEPT
16811681
{
16821682
p = 0;
16831683
}
@@ -2834,7 +2834,7 @@ struct Context::Impl
28342834
};
28352835

28362836

2837-
Context::Context()
2837+
Context::Context() CV_NOEXCEPT
28382838
{
28392839
p = 0;
28402840
}
@@ -3231,7 +3231,7 @@ struct Queue::Impl
32313231
cv::ocl::Queue profiling_queue_;
32323232
};
32333233

3234-
Queue::Queue()
3234+
Queue::Queue() CV_NOEXCEPT
32353235
{
32363236
p = 0;
32373237
}
@@ -3457,7 +3457,7 @@ static void CL_CALLBACK oclCleanupCallback(cl_event e, cl_int, void *p)
34573457

34583458
namespace cv { namespace ocl {
34593459

3460-
Kernel::Kernel()
3460+
Kernel::Kernel() CV_NOEXCEPT
34613461
{
34623462
p = 0;
34633463
}
@@ -4047,7 +4047,7 @@ struct ProgramSource::Impl
40474047
};
40484048

40494049

4050-
ProgramSource::ProgramSource()
4050+
ProgramSource::ProgramSource() CV_NOEXCEPT
40514051
{
40524052
p = 0;
40534053
}
@@ -4556,7 +4556,10 @@ struct Program::Impl
45564556
};
45574557

45584558

4559-
Program::Program() { p = 0; }
4559+
Program::Program() CV_NOEXCEPT
4560+
{
4561+
p = 0;
4562+
}
45604563

45614564
Program::Program(const ProgramSource& src,
45624565
const String& buildflags, String& errmsg)
@@ -6608,7 +6611,7 @@ struct PlatformInfo::Impl
66086611
int versionMinor_;
66096612
};
66106613

6611-
PlatformInfo::PlatformInfo()
6614+
PlatformInfo::PlatformInfo() CV_NOEXCEPT
66126615
{
66136616
p = 0;
66146617
}

modules/core/src/ocl_disabled.impl.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CV_EXPORTS_W void finish() { /* nothing */ }
3434

3535
CV_EXPORTS bool haveSVM() { return false; }
3636

37-
Device::Device() : p(NULL) { }
37+
Device::Device() CV_NOEXCEPT : p(NULL) { }
3838
Device::Device(void* d) : p(NULL) { OCL_NOT_AVAILABLE(); }
3939
Device::Device(const Device& d) : p(NULL) { }
4040
Device& Device::operator=(const Device& d) { return *this; }
@@ -147,7 +147,7 @@ const Device& Device::getDefault()
147147
/* static */ Device Device::fromHandle(void* d) { OCL_NOT_AVAILABLE(); }
148148

149149

150-
Context::Context() : p(NULL) { }
150+
Context::Context() CV_NOEXCEPT : p(NULL) { }
151151
Context::Context(int dtype) : p(NULL) { }
152152
Context::~Context() { }
153153
Context::Context(const Context& c) : p(NULL) { }
@@ -178,7 +178,7 @@ void Context::setUseSVM(bool enabled) { }
178178
void Context::release() { }
179179

180180

181-
Platform::Platform() : p(NULL) { }
181+
Platform::Platform() CV_NOEXCEPT : p(NULL) { }
182182
Platform::~Platform() { }
183183
Platform::Platform(const Platform&) : p(NULL) { }
184184
Platform& Platform::operator=(const Platform&) { return *this; }
@@ -198,7 +198,7 @@ void convertFromImage(void* cl_mem_image, UMat& dst) { OCL_NOT_AVAILABLE(); }
198198

199199
void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device) { OCL_NOT_AVAILABLE(); }
200200

201-
Queue::Queue() : p(NULL) { }
201+
Queue::Queue() CV_NOEXCEPT : p(NULL) { }
202202
Queue::Queue(const Context& c, const Device& d) : p(NULL) { OCL_NOT_AVAILABLE(); }
203203
Queue::~Queue() { }
204204
Queue::Queue(const Queue& q) {}
@@ -235,7 +235,7 @@ KernelArg KernelArg::Constant(const Mat& m)
235235
}
236236

237237

238-
Kernel::Kernel() : p(NULL) { }
238+
Kernel::Kernel() CV_NOEXCEPT : p(NULL) { }
239239
Kernel::Kernel(const char* kname, const Program& prog) : p(NULL) { OCL_NOT_AVAILABLE(); }
240240
Kernel::Kernel(const char* kname, const ProgramSource& prog, const String& buildopts, String* errmsg) : p(NULL) { OCL_NOT_AVAILABLE(); }
241241
Kernel::~Kernel() { }
@@ -264,7 +264,7 @@ size_t Kernel::localMemSize() const { OCL_NOT_AVAILABLE(); }
264264
void* Kernel::ptr() const { return NULL; }
265265

266266

267-
Program::Program() : p(NULL) { }
267+
Program::Program() CV_NOEXCEPT : p(NULL) { }
268268
Program::Program(const ProgramSource& src, const String& buildflags, String& errmsg) : p(NULL) { OCL_NOT_AVAILABLE(); }
269269
Program::Program(const Program& prog) : p(NULL) { }
270270
Program& Program::operator=(const Program& prog) { return *this; }
@@ -283,7 +283,7 @@ String Program::getPrefix() const { OCL_NOT_AVAILABLE(); }
283283
/* static */ String Program::getPrefix(const String& buildflags) { OCL_NOT_AVAILABLE(); }
284284

285285

286-
ProgramSource::ProgramSource() : p(NULL) { }
286+
ProgramSource::ProgramSource() CV_NOEXCEPT : p(NULL) { }
287287
ProgramSource::ProgramSource(const String& module, const String& name, const String& codeStr, const String& codeHash) : p(NULL) { }
288288
ProgramSource::ProgramSource(const String& prog) : p(NULL) { }
289289
ProgramSource::ProgramSource(const char* prog) : p(NULL) { }
@@ -298,7 +298,7 @@ ProgramSource::hash_t ProgramSource::hash() const { OCL_NOT_AVAILABLE(); }
298298
/* static */ ProgramSource ProgramSource::fromSPIR(const String& module, const String& name, const unsigned char* binary, const size_t size, const cv::String& buildOptions) { OCL_NOT_AVAILABLE(); }
299299

300300

301-
PlatformInfo::PlatformInfo() : p(NULL) { }
301+
PlatformInfo::PlatformInfo() CV_NOEXCEPT : p(NULL) { }
302302
PlatformInfo::PlatformInfo(void* id) : p(NULL) { OCL_NOT_AVAILABLE(); }
303303
PlatformInfo::~PlatformInfo() { }
304304

0 commit comments

Comments
 (0)