Home
last modified time | relevance | path

Searched refs:dctx (Results 1 – 25 of 66) sorted by relevance

123

/petsc/src/sys/objects/device/interface/
H A Ddcontext.cxx14 PetscErrorCode construct_(PetscDeviceContext dctx) const noexcept in construct_()
17 PetscCall(PetscArrayzero(dctx, 1)); in construct_()
18 …PetscCall(PetscHeaderCreate_Private((PetscObject)dctx, PETSC_DEVICE_CONTEXT_CLASSID, "PetscDeviceC… in construct_()
19 PetscCall(PetscLogObjectCreate((PetscObject)dctx)); in construct_()
21 PetscCallCXX(PetscObjectCast(dctx)->cpp = new CxxData{dctx}); in construct_()
22 PetscCall(underlying().reset(dctx, false)); in construct_()
26 static PetscErrorCode destroy_(PetscDeviceContext dctx) noexcept in destroy_() argument
29dctx->numChildren, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Device context still has %" PetscIn… in destroy_()
30 PetscTryTypeMethod(dctx, destroy); in destroy_()
31 PetscCall(PetscDeviceDestroy(&dctx->device)); in destroy_()
[all …]
H A Dmark_dcontext.cxx56 static PetscErrorCode PetscDeviceContextCreateEvent_Private(PetscDeviceContext dctx, PetscEvent *ev… in PetscDeviceContextCreateEvent_Private() argument
59 PetscValidDeviceContext(dctx, 1); in PetscDeviceContextCreateEvent_Private()
62 PetscCall(PetscDeviceContextGetDeviceType(dctx, &(*event)->dtype)); in PetscDeviceContextCreateEvent_Private()
63 PetscTryTypeMethod(dctx, createevent, *event); in PetscDeviceContextCreateEvent_Private()
75 static PetscErrorCode PetscDeviceContextRecordEvent_Private(PetscDeviceContext dctx, PetscEvent eve… in PetscDeviceContextRecordEvent_Private() argument
81 PetscValidDeviceContext(dctx, 1); in PetscDeviceContextRecordEvent_Private()
83 id = PetscObjectCast(dctx)->id; in PetscDeviceContextRecordEvent_Private()
84 state = PetscObjectCast(dctx)->state; in PetscDeviceContextRecordEvent_Private()
88 if (dctx->ops->recordevent) { in PetscDeviceContextRecordEvent_Private()
95 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in PetscDeviceContextRecordEvent_Private()
[all …]
H A Dglobal_dcontext.cxx26 static inline PetscErrorCode PetscSetDefaultCUPMStreamFromDeviceContext(PetscDeviceContext dctx, Pe… in PetscSetDefaultCUPMStreamFromDeviceContext() argument
33 PetscCall(PetscDeviceContextGetStreamHandle_Internal(dctx, &handle)); in PetscSetDefaultCUPMStreamFromDeviceContext()
41 PetscCall(PetscDeviceContextGetStreamHandle_Internal(dctx, &handle)); in PetscSetDefaultCUPMStreamFromDeviceContext()
46 (void)dctx, (void)dtype; in PetscSetDefaultCUPMStreamFromDeviceContext()
107 PetscErrorCode PetscDeviceContextGetCurrentContext(PetscDeviceContext *dctx) in PetscDeviceContextGetCurrentContext() argument
110 PetscAssertPointer(dctx, 1); in PetscDeviceContextGetCurrentContext()
115 *dctx = globalContext; in PetscDeviceContextGetCurrentContext()
142 PetscErrorCode PetscDeviceContextSetCurrentContext(PetscDeviceContext dctx) in PetscDeviceContextSetCurrentContext() argument
147 PetscCall(PetscDeviceContextGetOptionalNullContext_Internal(&dctx)); in PetscDeviceContextSetCurrentContext()
148dctx->setup, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "PetscDeviceContext %" PetscInt64_FMT " mu… in PetscDeviceContextSetCurrentContext()
[all …]
H A Dmemory.cxx180 static PetscErrorCode PetscDeviceCheckCapable_Private(PetscDeviceContext dctx, bool cond, const cha… in PetscDeviceCheckCapable_Private() argument
183 …ndle %s host memory", PetscObjectCast(dctx)->id, PetscObjectCast(dctx)->name, dctx->device ? Petsc… in PetscDeviceCheckCapable_Private()
325 PetscErrorCode PetscDeviceAllocate_Private(PetscDeviceContext dctx, PetscBool clear, PetscMemType m… in PetscDeviceAllocate_Private() argument
340 PetscCall(PetscDeviceContextGetOptionalNullContext_Internal(&dctx)); in PetscDeviceAllocate_Private()
343 if (dctx->ops->memalloc) { in PetscDeviceAllocate_Private()
344 PetscUseTypeMethod(dctx, memalloc, clear, mtype, n, alignment, ptr); in PetscDeviceAllocate_Private()
346 PetscCall(PetscDeviceCheckCapable_Private(dctx, PetscMemTypeHost(mtype), "allocating")); in PetscDeviceAllocate_Private()
352 …PetscCall(PetscDeviceContextMarkIntentFromID(dctx, id, PETSC_MEMORY_ACCESS_WRITE, "memory allocati… in PetscDeviceAllocate_Private()
391 PetscErrorCode PetscDeviceDeallocate_Private(PetscDeviceContext dctx, void *PETSC_RESTRICT ptr) in PetscDeviceDeallocate_Private() argument
414 PetscCall(PetscDeviceContextGetOptionalNullContext_Internal(&dctx)); in PetscDeviceDeallocate_Private()
[all …]
/petsc/src/binding/petsc4py/test/
H A Dtest_device.py9 dctx = PETSc.DeviceContext().getCurrent()
10 if not dctx:
12 self.assertEqual(dctx.getRefCount(), 2)
13 device = dctx.getDevice()
15 del dctx
16 dctx = PETSc.DeviceContext().getCurrent()
17 self.assertEqual(dctx.getRefCount(), 2)
18 device = dctx.getDevice()
20 del dctx
30 dctx = PETSc.DeviceContext().create()
[all …]
/petsc/src/sys/objects/device/tests/
H A Dex2.c7 PetscDeviceContext dctx = NULL, ddup = NULL; in main() local
13 PetscCall(PetscDeviceContextCreate(&dctx)); in main()
14 PetscCall(AssertDeviceContextExists(dctx)); in main()
15 PetscCall(PetscDeviceContextDestroy(&dctx)); in main()
16 PetscCall(AssertDeviceContextDoesNotExist(dctx)); in main()
18 PetscCall(PetscDeviceContextDestroy(&dctx)); in main()
19 PetscCall(AssertDeviceContextDoesNotExist(dctx)); in main()
22 dctx = NULL; in main()
23 PetscCall(PetscDeviceContextGetCurrentContext(&dctx)); in main()
24 PetscCall(AssertDeviceContextExists(dctx)); in main()
[all …]
H A Dex9.c5 static PetscErrorCode CheckIdle(PetscDeviceContext dctx, const char operation[]) in CheckIdle() argument
10 PetscCall(PetscDeviceContextQueryIdle(dctx, &idle)); in CheckIdle()
12 PetscCall(PetscDeviceContextView(dctx, NULL)); in CheckIdle()
18 static PetscErrorCode TestQueryIdle(PetscDeviceContext dctx) in TestQueryIdle() argument
24 PetscCall(PetscDeviceContextSynchronize(dctx)); in TestQueryIdle()
25 PetscCall(CheckIdle(dctx, "synchronization")); in TestQueryIdle()
29 PetscCall(CheckIdle(dctx, "creating unrelated dctx")); in TestQueryIdle()
33 PetscCall(CheckIdle(dctx, "destroying unrelated dctx")); in TestQueryIdle()
36 PetscCall(PetscDeviceContextDuplicate(dctx, &other)); in TestQueryIdle()
37 PetscCall(CheckIdle(dctx, "duplication")); in TestQueryIdle()
[all …]
H A Dex3.c6 static PetscErrorCode TestPetscDeviceContextDuplicate(PetscDeviceContext dctx) in TestPetscDeviceContextDuplicate() argument
14 PetscCall(PetscDeviceContextGetStreamType(dctx, &origStype)); in TestPetscDeviceContextDuplicate()
15 PetscCall(PetscDeviceContextGetDevice(dctx, &origDevice)); in TestPetscDeviceContextDuplicate()
18 PetscCall(PetscDeviceContextDuplicate(dctx, &ddup)); in TestPetscDeviceContextDuplicate()
20 if (dctx) PetscCheckCompatibleDeviceContexts(dctx, 1, ddup, 2); in TestPetscDeviceContextDuplicate()
25 PetscCall(PetscDeviceContextGetDevice(dctx, &parDevice)); in TestPetscDeviceContextDuplicate()
34 PetscCall(PetscDeviceContextGetStreamType(dctx, &parStype)); in TestPetscDeviceContextDuplicate()
42 if (dctx) PetscValidDeviceContext(dctx, 1); in TestPetscDeviceContextDuplicate()
49 PetscDeviceContext dctx; in main() local
56 PetscCall(PetscDeviceContextCreate(&dctx)); in main()
[all …]
H A Dex7.c20 static PetscErrorCode TestAllocate(PetscDeviceContext dctx, PetscRandom rand, PetscMemType mtype) in TestAllocate() argument
29 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in TestAllocate()
35 PetscCall(PetscDeviceMalloc(dctx, mtype, n, &ptr)); in TestAllocate()
41 PetscCall(PetscDeviceFree(dctx, ptr)); in TestAllocate()
51 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &char_ptr)); in TestAllocate()
52 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &short_ptr)); in TestAllocate()
53 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &int_ptr)); in TestAllocate()
54 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &double_ptr)); in TestAllocate()
55 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &long_int_ptr)); in TestAllocate()
58 PetscCall(PetscDeviceFree(dctx, char_ptr)); in TestAllocate()
[all …]
H A Dex8.c7 PetscDeviceContext dctx = NULL; in main() local
13 PetscCall(PetscDeviceContextCreate(&dctx)); in main()
14 PetscCall(AssertDeviceContextExists(dctx)); in main()
20 PetscCall(PetscDeviceContextSetDevice(dctx, device)); in main()
21 PetscCall(PetscDeviceContextGetDevice(dctx, &other_device)); in main()
27 PetscCall(PetscDeviceContextSetUp(dctx)); in main()
28 PetscCall(PetscDeviceContextGetDevice(dctx, &other_device)); in main()
33 PetscCall(PetscDeviceContextView(dctx, NULL)); in main()
34 PetscCall(PetscDeviceContextDestroy(&dctx)); in main()
39 PetscCall(PetscDeviceContextCreate(&dctx)); in main()
[all …]
H A Dex4.c47 static PetscErrorCode TestPetscDeviceContextForkJoin(PetscDeviceContext dctx) in TestPetscDeviceContextForkJoin() argument
54 PetscCall(DoFork(dctx, n, &sub)); in TestPetscDeviceContextForkJoin()
55 PetscCall(PetscDeviceContextJoin(dctx, n, PETSC_DEVICE_CONTEXT_JOIN_DESTROY, &sub)); in TestPetscDeviceContextForkJoin()
57 PetscCall(DoFork(dctx, n, &sub)); in TestPetscDeviceContextForkJoin()
58 PetscCall(PetscDeviceContextJoin(dctx, n, PETSC_DEVICE_CONTEXT_JOIN_DESTROY, &sub)); in TestPetscDeviceContextForkJoin()
61 PetscCall(DoFork(dctx, n + 1, &sub)); in TestPetscDeviceContextForkJoin()
65 PetscCall(PetscDeviceContextJoin(dctx, n - 1, PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC, &sub)); in TestPetscDeviceContextForkJoin()
67 PetscCall(PetscDeviceContextJoin(dctx, n + 1, PETSC_DEVICE_CONTEXT_JOIN_DESTROY, &sub)); in TestPetscDeviceContextForkJoin()
74 PetscDeviceContext dctx; in main() local
80 PetscCall(PetscDeviceContextCreate(&dctx)); in main()
[all …]
/petsc/src/sys/objects/device/impls/cupm/cuda/
H A Dcupmcontext.cu5 PetscErrorCode PetscDeviceContextCreate_CUDA(PetscDeviceContext dctx) in PetscDeviceContextCreate_CUDA() argument
10 PetscCall(cuda_context.initialize(dctx->device)); in PetscDeviceContextCreate_CUDA()
11 dctx->data = new PetscDeviceContext_(CUDA); in PetscDeviceContextCreate_CUDA()
12 *dctx->ops = cuda_context.ops; in PetscDeviceContextCreate_CUDA()
19 PetscDeviceContext dctx; in PetscCUBLASGetHandle() local
23 PetscCall(PetscDeviceContextGetCurrentContextAssertType_Internal(&dctx, PETSC_DEVICE_CUDA)); in PetscCUBLASGetHandle()
24 PetscCall(PetscDeviceContextGetBLASHandle_Internal(dctx, handle)); in PetscCUBLASGetHandle()
30 PetscDeviceContext dctx; in PetscCUSOLVERDnGetHandle() local
34 PetscCall(PetscDeviceContextGetCurrentContextAssertType_Internal(&dctx, PETSC_DEVICE_CUDA)); in PetscCUSOLVERDnGetHandle()
35 PetscCall(PetscDeviceContextGetSOLVERHandle_Internal(dctx, handle)); in PetscCUSOLVERDnGetHandle()
[all …]
/petsc/src/sys/objects/device/impls/cupm/hip/
H A Dcupmcontext.hip.cxx5 PetscErrorCode PetscDeviceContextCreate_HIP(PetscDeviceContext dctx) in PetscDeviceContextCreate_HIP() argument
10 PetscCall(hip_context.initialize(dctx->device)); in PetscDeviceContextCreate_HIP()
11 dctx->data = new PetscDeviceContext_(HIP); in PetscDeviceContextCreate_HIP()
12 *dctx->ops = hip_context.ops; in PetscDeviceContextCreate_HIP()
27 PetscDeviceContext dctx; in PetscHIPBLASGetHandle() local
31 PetscCall(PetscDeviceContextGetCurrentContextAssertType_Internal(&dctx, PETSC_DEVICE_HIP)); in PetscHIPBLASGetHandle()
32 PetscCall(PetscDeviceContextGetBLASHandle_Internal(dctx, handle)); in PetscHIPBLASGetHandle()
38 PetscDeviceContext dctx; in PetscHIPSOLVERGetHandle() local
42 PetscCall(PetscDeviceContextGetCurrentContextAssertType_Internal(&dctx, PETSC_DEVICE_HIP)); in PetscHIPSOLVERGetHandle()
43 PetscCall(PetscDeviceContextGetSOLVERHandle_Internal(dctx, handle)); in PetscHIPSOLVERGetHandle()
[all …]
/petsc/src/sys/objects/device/tests/output/
H A Dex7_with_info_host_no_device.out3 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 56 (memory allocation): ne…
4 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 56 (memory a…
5 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 56 (memory deallocation): …
6 [0] <device> MarkFromID_IncompatibleModes_UpdateLastWrite(): dctx 53 (global root) - obj 56 (memory…
7 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 56 (memory d…
8 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 60 (memory allocation): ne…
9 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 60 (memory a…
10 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 61 (memory allocation): ne…
11 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 61 (memory a…
12 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 62 (memory allocation): ne…
[all …]
H A Dex7_with_info_host_with_device.out3 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 56 (memory allocation): ne…
4 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 56 (memory a…
5 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 56 (memory deallocation): …
6 [0] <device> MarkFromID_IncompatibleModes_UpdateLastWrite(): dctx 53 (global root) - obj 56 (memory…
7 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 56 (memory d…
8 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 60 (memory allocation): ne…
9 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 60 (memory a…
10 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 61 (memory allocation): ne…
11 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 61 (memory a…
12 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 62 (memory allocation): ne…
[all …]
H A Dex7_with_info_sycl.out3 [0] <device> MarkFromID_IncompatibleModes(): dctx 2 (global root) - obj 8 (memory allocation): new …
4 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 2 (global root) - obj 8 (memory all…
5 [0] <device> MarkFromID_IncompatibleModes(): dctx 2 (global root) - obj 8 (memory deallocation): ne…
6 [0] <device> MarkFromID_IncompatibleModes_UpdateLastWrite(): dctx 2 (global root) - obj 8 (memory d…
7 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 2 (global root) - obj 8 (memory dea…
8 [0] <device> MarkFromID_IncompatibleModes(): dctx 2 (global root) - obj 12 (memory allocation): new…
9 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 2 (global root) - obj 12 (memory al…
10 [0] <device> MarkFromID_IncompatibleModes(): dctx 2 (global root) - obj 13 (memory allocation): new…
11 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 2 (global root) - obj 13 (memory al…
12 [0] <device> MarkFromID_IncompatibleModes(): dctx 2 (global root) - obj 14 (memory allocation): new…
[all …]
H A Dex7_with_info_cuda.out3 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 58 (memory allocation): ne…
4 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 58 (memory a…
5 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 58 (memory deallocation): …
6 [0] <device> MarkFromID_IncompatibleModes_UpdateLastWrite(): dctx 53 (global root) - obj 58 (memory…
7 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 58 (memory d…
8 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 63 (memory allocation): ne…
9 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 63 (memory a…
10 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 64 (memory allocation): ne…
11 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 64 (memory a…
12 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 65 (memory allocation): ne…
[all …]
H A Dex7_with_info_hip.out3 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 58 (memory allocation): ne…
4 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 58 (memory a…
5 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 58 (memory deallocation): …
6 [0] <device> MarkFromID_IncompatibleModes_UpdateLastWrite(): dctx 53 (global root) - obj 58 (memory…
7 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 58 (memory d…
8 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 63 (memory allocation): ne…
9 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 63 (memory a…
10 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 64 (memory allocation): ne…
11 [0] <device> PetscDeviceContextMarkIntentFromID_Private(): dctx 53 (global root) - obj 64 (memory a…
12 [0] <device> MarkFromID_IncompatibleModes(): dctx 53 (global root) - obj 65 (memory allocation): ne…
[all …]
/petsc/src/sys/objects/device/c/
H A Ddevice.c74 PetscErrorCode PetscDeviceContextCreate(PetscDeviceContext *dctx) in PetscDeviceContextCreate() argument
77 PetscAssertPointer(dctx, 1); in PetscDeviceContextCreate()
78 *dctx = NULL; in PetscDeviceContextCreate()
82 PetscErrorCode PetscDeviceContextDestroy(PetscDeviceContext *dctx) in PetscDeviceContextDestroy() argument
85 PetscAssertPointer(dctx, 1); in PetscDeviceContextDestroy()
86 if (*dctx) *dctx = NULL; in PetscDeviceContextDestroy()
90 PetscErrorCode PetscDeviceContextSetStreamType(PETSC_UNUSED PetscDeviceContext dctx, PETSC_UNUSED P… in PetscDeviceContextSetStreamType() argument
96 PetscErrorCode PetscDeviceContextGetStreamType(PETSC_UNUSED PetscDeviceContext dctx, PetscStreamTyp… in PetscDeviceContextGetStreamType() argument
104 PetscErrorCode PetscDeviceContextSetDevice(PETSC_UNUSED PetscDeviceContext dctx, PETSC_UNUSED Petsc… in PetscDeviceContextSetDevice() argument
110 PetscErrorCode PetscDeviceContextGetDevice(PETSC_UNUSED PetscDeviceContext dctx, PetscDevice *devic… in PetscDeviceContextGetDevice() argument
[all …]
/petsc/src/sys/objects/device/impls/sycl/
H A Dsyclcontext.sycl.cxx41 static PetscErrorCode initialize_(PetscInt id, PetscDeviceContext dctx) noexcept in initialize_() argument
60 static PetscErrorCode destroy(PetscDeviceContext dctx) noexcept in destroy() argument
63 delete static_cast<PetscDeviceContext_SYCL *>(dctx->data); in destroy()
64 dctx->data = nullptr; in destroy()
68 static PetscErrorCode setUp(PetscDeviceContext dctx) noexcept in setUp() argument
75 static_cast<PetscDeviceContext_SYCL *>(dctx->data)->timerInUse = PETSC_FALSE; in setUp()
77 PetscCall(PetscDeviceContextGetDevice(dctx, &dev)); in setUp()
81 …static_cast<PetscDeviceContext_SYCL *>(dctx->data)->queue = ::sycl::queue(syclDevice, ::sycl::prop… in setUp()
85 static PetscErrorCode query(PetscDeviceContext dctx, PetscBool *idle) noexcept in query() argument
94 static PetscErrorCode synchronize(PetscDeviceContext dctx) noexcept in synchronize() argument
[all …]
/petsc/src/ksp/ksp/utils/lmvm/blas_cyclic/cupm/
H A Dblas_cyclic_cupm.cxx32 PetscDeviceContext dctx; in AXPBYCyclic_CUPM_Private() local
36 PetscCall(PetscDeviceContextGetCurrentContext(&dctx)); in AXPBYCyclic_CUPM_Private()
37 PetscCall(PetscDeviceContextGetDeviceType(dctx, &device_type)); in AXPBYCyclic_CUPM_Private()
41 …e::cupm::impl::BLASCyclic<::Petsc::device::cupm::DeviceType::CUDA>::axpby(dctx, m, oldest, next, a… in AXPBYCyclic_CUPM_Private()
46 …ce::cupm::impl::BLASCyclic<::Petsc::device::cupm::DeviceType::HIP>::axpby(dctx, m, oldest, next, a… in AXPBYCyclic_CUPM_Private()
57 PetscDeviceContext dctx; in DMVCyclic_CUPM_Private() local
61 PetscCall(PetscDeviceContextGetCurrentContext(&dctx)); in DMVCyclic_CUPM_Private()
62 PetscCall(PetscDeviceContextGetDeviceType(dctx, &device_type)); in DMVCyclic_CUPM_Private()
66 …ice::cupm::impl::BLASCyclic<::Petsc::device::cupm::DeviceType::CUDA>::dmv(dctx, hermitian_transpos… in DMVCyclic_CUPM_Private()
71 …vice::cupm::impl::BLASCyclic<::Petsc::device::cupm::DeviceType::HIP>::dmv(dctx, hermitian_transpos… in DMVCyclic_CUPM_Private()
[all …]
/petsc/src/vec/is/sf/tests/
H A Dex23.c16 PetscDeviceContext dctx; in main() local
32 PetscCall(PetscDeviceContextGetCurrentContext(&dctx)); in main()
36 PetscCall(PetscDeviceMalloc(dctx, PETSC_MEMTYPE_HOST, n2, &xh)); in main()
37 PetscCall(PetscDeviceMalloc(dctx, PETSC_MEMTYPE_HOST, n2, &yh)); in main()
38 PetscCall(PetscDeviceMalloc(dctx, PETSC_MEMTYPE_DEVICE, n2, &xd)); in main()
39 PetscCall(PetscDeviceMalloc(dctx, PETSC_MEMTYPE_DEVICE, n2, &yd)); in main()
45 PetscCall(PetscDeviceMemcpy(dctx, xd, xh, sizeof(PetscInt) * n2)); in main()
46 PetscCall(PetscDeviceMemcpy(dctx, yd, yh, sizeof(PetscInt) * n2)); in main()
50 PetscCall(PetscDeviceMemcpy(dctx, yh, yd, sizeof(PetscInt) * n)); in main()
51 PetscCall(PetscDeviceContextSynchronize(dctx)); // finish the async memcpy in main()
[all …]
/petsc/src/sys/objects/device/impls/cupm/
H A Dcupmcontext.hpp93 static PetscErrorCode initialize_handle_(blas_tag, PetscDeviceContext dctx) noexcept in initialize_handle_() argument
95 const auto dci = impls_cast_(dctx); in initialize_handle_()
96 auto &handle = blashandles_[dctx->device->deviceId]; in initialize_handle_()
120 static PetscErrorCode initialize_handle_(solver_tag, PetscDeviceContext dctx) noexcept in initialize_handle_() argument
122 const auto dci = impls_cast_(dctx); in initialize_handle_()
123 auto &handle = solverhandles_[dctx->device->deviceId]; in initialize_handle_()
160 …orCode check_current_device_(PetscDeviceContext dctx) noexcept { return check_current_device_(dctx in check_current_device_() argument
280 inline PetscErrorCode DeviceContext<T>::destroy(PetscDeviceContext dctx) noexcept in destroy() argument
283 if (const auto dci = impls_cast_(dctx)) { in destroy()
289 dctx->data = nullptr; in destroy()
[all …]
/petsc/include/petsc/private/
H A Ddeviceimpl.h120 #define PetscValidDeviceContext(dctx, argno) \ argument
122 PetscDeviceContext pvdc_dctx_ = dctx; \
154 #define PetscValidDeviceContext(dctx, argno) argument
306 static inline PetscErrorCode PetscDeviceContextGetBLASHandle_Internal(PetscDeviceContext dctx, void… in PetscDeviceContextGetBLASHandle_Internal() argument
310 PetscValidDeviceContext(dctx, 1); in PetscDeviceContextGetBLASHandle_Internal()
311 PetscUseTypeMethod(dctx, getblashandle, handle); in PetscDeviceContextGetBLASHandle_Internal()
315 static inline PetscErrorCode PetscDeviceContextGetSOLVERHandle_Internal(PetscDeviceContext dctx, vo… in PetscDeviceContextGetSOLVERHandle_Internal() argument
319 PetscValidDeviceContext(dctx, 1); in PetscDeviceContextGetSOLVERHandle_Internal()
320 PetscUseTypeMethod(dctx, getsolverhandle, handle); in PetscDeviceContextGetSOLVERHandle_Internal()
324 static inline PetscErrorCode PetscDeviceContextGetStreamHandle_Internal(PetscDeviceContext dctx, vo… in PetscDeviceContextGetStreamHandle_Internal() argument
[all …]
/petsc/src/vec/vec/impls/seq/cupm/
H A Dvecseqcupm_impl.hpp175 inline PetscErrorCode VecSeq_CUPM<T>::CreateSeqCUPM_(Vec v, PetscDeviceContext dctx, PetscScalar *h… in CreateSeqCUPM_() argument
179 PetscCall(Initialize_CUPMBase(v, PETSC_FALSE, host_array, device_array, dctx)); in CreateSeqCUPM_()
185 …ointwiseBinary_(BinaryFuncT &&binary, Vec xin, Vec yin, Vec zout, PetscDeviceContext dctx) noexcept in PointwiseBinary_() argument
191 PetscCall(PetscDeviceContextGetOptionalNullContext_Internal(&dctx)); in PointwiseBinary_()
192 PetscCall(GetHandlesFrom_(dctx, &stream)); in PointwiseBinary_()
195 const auto dxptr = thrust::device_pointer_cast(DeviceArrayRead(dctx, xin).data()); in PointwiseBinary_()
201 thrust::device_pointer_cast(DeviceArrayRead(dctx, yin).data()), in PointwiseBinary_()
202 thrust::device_pointer_cast(DeviceArrayWrite(dctx, zout).data()), in PointwiseBinary_()
208 PetscCall(PetscDeviceContextSynchronizeIfWithBarrier_Internal(dctx)); in PointwiseBinary_()
217 …Vec, Vec, Vec), BinaryFuncT &&binary, Vec wout, Vec xin, Vec yin, PetscDeviceContext dctx) noexcept in PointwiseBinaryDispatch_() argument
[all …]

123