24
24
// traces using the trace framework
25
25
#include " xpti/xpti_trace_framework.hpp"
26
26
27
- #define XPTI_CREATE_TRACEPOINT (CodeLoc ) \
27
+ #define XPTI_CREATE_TRACEPOINT (CodeLoc ) \
28
28
std::unique_ptr<xpti::framework::tracepoint_t > _TP (nullptr ); \
29
29
if (xptiTraceEnabled()) { \
30
- xpti::payload_t Payload{CodeLoc.functionName (), CodeLoc.fileName (), \
31
- static_cast <int >(CodeLoc.lineNumber ()), \
32
- static_cast <int >(CodeLoc.columnNumber ()), nullptr }; \
30
+ xpti::payload_t Payload{CodeLoc.functionName (), CodeLoc.fileName (), \
31
+ static_cast <int >(CodeLoc.lineNumber ()), \
32
+ static_cast <int >(CodeLoc.columnNumber ()), \
33
+ nullptr }; \
33
34
_TP = std::make_unique<xpti::framework::tracepoint_t >(&Payload); \
34
35
} \
35
36
(void )_TP;
@@ -216,7 +217,8 @@ void *alignedAlloc(size_t Alignment, size_t Size, const context &Ctxt,
216
217
return RetVal;
217
218
}
218
219
219
- void free (void *Ptr, const context &Ctxt, const detail::code_location &CodeLoc) {
220
+ void free (void *Ptr, const context &Ctxt,
221
+ const detail::code_location &CodeLoc) {
220
222
XPTI_CREATE_TRACEPOINT (CodeLoc);
221
223
if (Ptr == nullptr )
222
224
return ;
@@ -290,7 +292,8 @@ aligned_alloc_device(size_t Alignment, size_t Size, const queue &Q,
290
292
const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
291
293
_CODELOCARG (&CodeLoc);
292
294
return detail::usm::alignedAlloc (Alignment, Size, Q.get_context (),
293
- Q.get_device (), alloc::device, PropList, CodeLoc);
295
+ Q.get_device (), alloc::device, PropList,
296
+ CodeLoc);
294
297
}
295
298
296
299
void free (void *ptr, const context &Ctxt _CODELOCPARAMDEF (&CodeLoc)) {
@@ -363,8 +366,9 @@ void *aligned_alloc_host(size_t Alignment, size_t Size,
363
366
property_list{}, CodeLoc);
364
367
}
365
368
366
- void *aligned_alloc_host (size_t Alignment, size_t Size, const context &Ctxt,
367
- const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
369
+ void *
370
+ aligned_alloc_host (size_t Alignment, size_t Size, const context &Ctxt,
371
+ const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
368
372
_CODELOCARG (&CodeLoc);
369
373
return detail::usm::alignedAllocHost (Alignment, Size, Ctxt, alloc::host,
370
374
PropList, CodeLoc);
@@ -377,8 +381,9 @@ void *aligned_alloc_host(size_t Alignment, size_t Size,
377
381
alloc::host, property_list{}, CodeLoc);
378
382
}
379
383
380
- void *aligned_alloc_host (size_t Alignment, size_t Size, const queue &Q,
381
- const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
384
+ void *
385
+ aligned_alloc_host (size_t Alignment, size_t Size, const queue &Q,
386
+ const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
382
387
_CODELOCARG (&CodeLoc);
383
388
return detail::usm::alignedAllocHost (Alignment, Size, Q.get_context (),
384
389
alloc::host, PropList, CodeLoc);
@@ -413,7 +418,8 @@ aligned_alloc_shared(size_t Alignment, size_t Size, const queue &Q,
413
418
const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
414
419
_CODELOCARG (&CodeLoc);
415
420
return detail::usm::alignedAlloc (Alignment, Size, Q.get_context (),
416
- Q.get_device (), alloc::shared, PropList, CodeLoc);
421
+ Q.get_device (), alloc::shared, PropList,
422
+ CodeLoc);
417
423
}
418
424
419
425
// single form
@@ -422,78 +428,83 @@ void *malloc(size_t Size, const device &Dev, const context &Ctxt, alloc Kind,
422
428
const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
423
429
_CODELOCARG (&CodeLoc);
424
430
if (Kind == alloc::host)
425
- return detail::usm::alignedAllocHost (0 , Size, Ctxt, Kind, PropList, CodeLoc);
431
+ return detail::usm::alignedAllocHost (0 , Size, Ctxt, Kind, PropList,
432
+ CodeLoc);
426
433
return detail::usm::alignedAlloc (0 , Size, Ctxt, Dev, Kind, PropList, CodeLoc);
427
434
}
428
435
429
436
void *malloc (size_t Size, const device &Dev, const context &Ctxt,
430
437
alloc Kind _CODELOCPARAMDEF (&CodeLoc)) {
431
438
_CODELOCARG (&CodeLoc);
432
439
if (Kind == alloc::host)
433
- return detail::usm::alignedAllocHost (0 , Size, Ctxt, Kind, property_list{}, CodeLoc);
434
- return detail::usm::alignedAlloc (0 , Size, Ctxt, Dev, Kind,
435
- property_list{}, CodeLoc);
440
+ return detail::usm::alignedAllocHost (0 , Size, Ctxt, Kind, property_list{},
441
+ CodeLoc);
442
+ return detail::usm::alignedAlloc (0 , Size, Ctxt, Dev, Kind, property_list{},
443
+ CodeLoc);
436
444
}
437
445
438
- void *malloc (size_t Size, const queue &Q, alloc Kind _CODELOCPARAMDEF (&CodeLoc)) {
446
+ void *malloc (size_t Size, const queue &Q,
447
+ alloc Kind _CODELOCPARAMDEF (&CodeLoc)) {
439
448
_CODELOCARG (&CodeLoc);
440
449
if (Kind == alloc::host)
441
450
return detail::usm::alignedAllocHost (0 , Size, Q.get_context (), Kind,
442
- property_list{}, CodeLoc);
443
- return detail::usm::alignedAlloc (0 , Size, Q.get_context (), Q.get_device (),
444
- Kind, property_list{}, CodeLoc);
451
+ property_list{}, CodeLoc);
452
+ return detail::usm::alignedAlloc (0 , Size, Q.get_context (), Q.get_device (),
453
+ Kind, property_list{}, CodeLoc);
445
454
}
446
455
447
456
void *malloc (size_t Size, const queue &Q, alloc Kind,
448
457
const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
449
458
_CODELOCARG (&CodeLoc);
450
459
if (Kind == alloc::host)
451
460
return detail::usm::alignedAllocHost (0 , Size, Q.get_context (), Kind,
452
- PropList, CodeLoc);
453
- return detail::usm::alignedAlloc (0 , Size, Q.get_context (), Q.get_device (),
454
- Kind, PropList, CodeLoc);
461
+ PropList, CodeLoc);
462
+ return detail::usm::alignedAlloc (0 , Size, Q.get_context (), Q.get_device (),
463
+ Kind, PropList, CodeLoc);
455
464
}
456
465
457
466
void *aligned_alloc (size_t Alignment, size_t Size, const device &Dev,
458
- const context &Ctxt, alloc Kind _CODELOCPARAMDEF (&CodeLoc)) {
467
+ const context &Ctxt,
468
+ alloc Kind _CODELOCPARAMDEF (&CodeLoc)) {
459
469
_CODELOCARG (&CodeLoc);
460
470
if (Kind == alloc::host)
461
471
return detail::usm::alignedAllocHost (Alignment, Size, Ctxt, Kind,
462
- property_list{}, CodeLoc);
472
+ property_list{}, CodeLoc);
463
473
464
- return detail::usm::alignedAlloc (Alignment, Size, Ctxt, Dev, Kind,
465
- property_list{}, CodeLoc);
474
+ return detail::usm::alignedAlloc (Alignment, Size, Ctxt, Dev, Kind,
475
+ property_list{}, CodeLoc);
466
476
}
467
477
468
478
void *aligned_alloc (size_t Alignment, size_t Size, const device &Dev,
469
479
const context &Ctxt, alloc Kind,
470
480
const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
471
481
_CODELOCARG (&CodeLoc);
472
482
if (Kind == alloc::host)
473
- return detail::usm::alignedAllocHost (Alignment, Size, Ctxt, Kind,
474
- PropList, CodeLoc);
475
- return detail::usm::alignedAlloc (Alignment, Size, Ctxt, Dev, Kind,
476
- PropList, CodeLoc);
483
+ return detail::usm::alignedAllocHost (Alignment, Size, Ctxt, Kind, PropList,
484
+ CodeLoc);
485
+ return detail::usm::alignedAlloc (Alignment, Size, Ctxt, Dev, Kind, PropList ,
486
+ CodeLoc);
477
487
}
478
488
479
489
void *aligned_alloc (size_t Alignment, size_t Size, const queue &Q,
480
490
alloc Kind _CODELOCPARAMDEF (&CodeLoc)) {
481
491
_CODELOCARG (&CodeLoc);
482
492
if (Kind == alloc::host)
483
- return detail::usm::alignedAllocHost (Alignment, Size, Q.get_context (),
484
- Kind, property_list{}, CodeLoc);
485
- return detail::usm::alignedAlloc (Alignment, Size, Q.get_context (),
486
- Q.get_device (), Kind, property_list{}, CodeLoc);
493
+ return detail::usm::alignedAllocHost (Alignment, Size, Q.get_context (), Kind,
494
+ property_list{}, CodeLoc);
495
+ return detail::usm::alignedAlloc (Alignment, Size, Q.get_context (),
496
+ Q.get_device (), Kind, property_list{},
497
+ CodeLoc);
487
498
}
488
499
489
500
void *aligned_alloc (size_t Alignment, size_t Size, const queue &Q, alloc Kind,
490
501
const property_list &PropList _CODELOCPARAMDEF (&CodeLoc)) {
491
502
_CODELOCARG (&CodeLoc);
492
503
if (Kind == alloc::host)
493
- return detail::usm::alignedAllocHost (Alignment, Size, Q.get_context (),
494
- Kind, PropList, CodeLoc);
495
- return detail::usm::alignedAlloc (Alignment, Size, Q.get_context (),
496
- Q.get_device (), Kind, PropList, CodeLoc);
504
+ return detail::usm::alignedAllocHost (Alignment, Size, Q.get_context (), Kind,
505
+ PropList, CodeLoc);
506
+ return detail::usm::alignedAlloc (Alignment, Size, Q.get_context (),
507
+ Q.get_device (), Kind, PropList, CodeLoc);
497
508
}
498
509
499
510
// Pointer queries
0 commit comments