1 /// @file 2 /// Test CeedVectorGetArray state counter 3 /// \test Test CeedVectorGetArray state counter 4 5 //TESTARGS(only="cpu") {ceed_resource} 6 #include <ceed.h> 7 8 int main(int argc, char **argv) { 9 Ceed ceed; 10 CeedVector x; 11 CeedInt len = 10; 12 CeedScalar *a, *b; 13 14 CeedInit(argv[1], &ceed); 15 16 CeedVectorCreate(ceed, len, &x); 17 CeedVectorSetValue(x, 0.0); 18 19 // Two write accesses should generate an error 20 CeedVectorGetArray(x, CEED_MEM_HOST, &a); 21 CeedVectorGetArray(x, CEED_MEM_HOST, &b); 22 23 // LCOV_EXCL_START 24 CeedVectorRestoreArray(x, &a); 25 CeedVectorRestoreArray(x, &b); 26 27 CeedVectorDestroy(&x); 28 CeedDestroy(&ceed); 29 return 0; 30 // LCOV_EXCL_STOP 31 } 32