Lines Matching refs:descriptor

28     const CFI_cdesc_t *descriptor, const CFI_index_t subscripts[]) {  in CFI_address()  argument
29 char *p{static_cast<char *>(descriptor->base_addr)}; in CFI_address()
30 const CFI_rank_t rank{descriptor->rank}; in CFI_address()
31 const CFI_dim_t *dim{descriptor->dim}; in CFI_address()
38 int CFI_allocate(CFI_cdesc_t *descriptor, const CFI_index_t lower_bounds[], in CFI_allocate() argument
40 if (!descriptor) { in CFI_allocate()
43 if (descriptor->version != CFI_VERSION) { in CFI_allocate()
46 if (descriptor->attribute != CFI_attribute_allocatable && in CFI_allocate()
47 descriptor->attribute != CFI_attribute_pointer) { in CFI_allocate()
51 if (descriptor->attribute == CFI_attribute_allocatable && in CFI_allocate()
52 descriptor->base_addr) { in CFI_allocate()
55 if (descriptor->rank > CFI_MAX_RANK) { in CFI_allocate()
58 if (descriptor->type < CFI_type_signed_char || in CFI_allocate()
59 descriptor->type > CFI_TYPE_LAST) { in CFI_allocate()
62 if (!IsCharacterType(descriptor->type)) { in CFI_allocate()
63 elem_len = descriptor->elem_len; in CFI_allocate()
68 std::size_t rank{descriptor->rank}; in CFI_allocate()
69 CFI_dim_t *dim{descriptor->dim}; in CFI_allocate()
84 descriptor->base_addr = p; in CFI_allocate()
85 descriptor->elem_len = elem_len; in CFI_allocate()
89 int CFI_deallocate(CFI_cdesc_t *descriptor) { in CFI_deallocate() argument
90 if (!descriptor) { in CFI_deallocate()
93 if (descriptor->version != CFI_VERSION) { in CFI_deallocate()
96 if (descriptor->attribute != CFI_attribute_allocatable && in CFI_deallocate()
97 descriptor->attribute != CFI_attribute_pointer) { in CFI_deallocate()
101 if (!descriptor->base_addr) { in CFI_deallocate()
104 std::free(descriptor->base_addr); in CFI_deallocate()
105 descriptor->base_addr = nullptr; in CFI_deallocate()
239 int CFI_establish(CFI_cdesc_t *descriptor, void *base_addr, in CFI_establish() argument
258 if (!descriptor) { in CFI_establish()
270 descriptor->base_addr = base_addr; in CFI_establish()
271 descriptor->elem_len = elem_len; in CFI_establish()
272 descriptor->version = CFI_VERSION; in CFI_establish()
273 descriptor->rank = rank; in CFI_establish()
274 descriptor->type = type; in CFI_establish()
275 descriptor->attribute = attribute; in CFI_establish()
276 descriptor->f18Addendum = 0; in CFI_establish()
281 descriptor->dim[j].lower_bound = lower_bound; in CFI_establish()
282 descriptor->dim[j].extent = extents[j]; in CFI_establish()
283 descriptor->dim[j].sm = byteSize; in CFI_establish()
290 int CFI_is_contiguous(const CFI_cdesc_t *descriptor) { in CFI_is_contiguous() argument
291 CFI_index_t bytes = descriptor->elem_len; in CFI_is_contiguous()
292 for (int j{0}; j < descriptor->rank; ++j) { in CFI_is_contiguous()
293 if (bytes != descriptor->dim[j].sm) { in CFI_is_contiguous()
296 bytes *= descriptor->dim[j].extent; in CFI_is_contiguous()