Lines Matching refs:ptr

22   PetscScalar *ptr, *tmp_ptr;  in TestAllocate()  local
35 PetscCall(PetscDeviceMalloc(dctx, mtype, n, &ptr)); in TestAllocate()
36 …PetscCheck(ptr, PETSC_COMM_SELF, PETSC_ERR_POINTER, "PetscDeviceMalloc() return NULL pointer for %… in TestAllocate()
39 for (PetscInt i = 0; i < n; ++i) ptr[i] = (PetscScalar)i; in TestAllocate()
41 PetscCall(PetscDeviceFree(dctx, ptr)); in TestAllocate()
67 PetscCall(PetscDeviceCalloc(dctx, mtype, n, &ptr)); in TestAllocate()
68 …PetscCheck(ptr, PETSC_COMM_SELF, PETSC_ERR_POINTER, "PetscDeviceCalloc() returned NULL pointer for… in TestAllocate()
70 tmp_ptr = ptr; in TestAllocate()
73 PetscCall(PetscDeviceArrayCopy(dctx, tmp_ptr, ptr, n)); in TestAllocate()
77 if (tmp_ptr == ptr) { in TestAllocate()
82 PetscCall(PetscDeviceFree(dctx, ptr)); in TestAllocate()
86 PetscCall(PetscDeviceMalloc(dctx, mtype, n, &ptr)); in TestAllocate()
87 PetscCall(PetscDeviceArrayZero(dctx, ptr, n)); in TestAllocate()
91 PetscCall(PetscDeviceArrayCopy(dctx, tmp_ptr, ptr, n)); in TestAllocate()
95 PetscCall(PetscDeviceFree(dctx, ptr)); in TestAllocate()
103 PetscScalar *ptr, *tmp_ptr; in TestAsyncCoherence() local
113 PetscCall(PetscDeviceMalloc(sub[i], PETSC_MEMTYPE_HOST, n, &ptr)); in TestAsyncCoherence()
114 PetscCall(PetscDeviceFree(sub[i], ptr)); in TestAsyncCoherence()
116 PetscCall(PetscDeviceMalloc(sub[i], PETSC_MEMTYPE_DEVICE, n, &ptr)); in TestAsyncCoherence()
117 PetscCall(PetscDeviceFree(sub[i], ptr)); in TestAsyncCoherence()
122 PetscCall(PetscDeviceMalloc(sub[0], PETSC_MEMTYPE_HOST, n, &ptr)); in TestAsyncCoherence()
124 PetscCall(PetscDeviceFree(sub[1], ptr)); in TestAsyncCoherence()
127 PetscCall(PetscDeviceMalloc(sub[0], PETSC_MEMTYPE_HOST, n, &ptr)); in TestAsyncCoherence()
129 PetscCall(PetscDeviceArrayZero(sub[1], ptr, n)); in TestAsyncCoherence()
132ptr[i] == (PetscScalar)0.0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "PetscDeviceArrayZero() was not prope… in TestAsyncCoherence()
134 PetscCall(PetscDeviceFree(sub[1], ptr)); in TestAsyncCoherence()
138 PetscCall(PetscDeviceCalloc(dctx, PETSC_MEMTYPE_DEVICE, n, &ptr)); in TestAsyncCoherence()
140 PetscCall(PetscDeviceArrayCopy(sub[0], tmp_ptr, ptr, n)); in TestAsyncCoherence()
145 PetscCall(PetscDeviceFree(sub[1], ptr)); in TestAsyncCoherence()