• Home
  • Raw
  • Download

Lines Matching refs:clc

97 open_clc_data(struct clc_data *clc, unsigned ptr_bit_size)  in open_clc_data()  argument
99 memset(clc, 0, sizeof(*clc)); in open_clc_data()
100 clc->file = get_libclc_file(ptr_bit_size); in open_clc_data()
101 clc->fd = -1; in open_clc_data()
103 if (clc->file->static_data) { in open_clc_data()
104 snprintf((char *)clc->cache_key, sizeof(clc->cache_key), in open_clc_data()
110 if (clc->file->sys_path != NULL) { in open_clc_data()
111 int fd = open(clc->file->sys_path, O_RDONLY); in open_clc_data()
118 fprintf(stderr, "fstat failed on %s: %m\n", clc->file->sys_path); in open_clc_data()
125 _mesa_sha1_update(&ctx, clc->file->sys_path, strlen(clc->file->sys_path)); in open_clc_data()
127 _mesa_sha1_final(&ctx, clc->cache_key); in open_clc_data()
129 clc->fd = fd; in open_clc_data()
141 map_clc_data(struct clc_data *clc) in map_clc_data() argument
143 if (clc->file->static_data) { in map_clc_data()
146 ZSTD_getFrameContentSize(clc->file->static_data, in map_clc_data()
147 clc->file->static_data_size); in map_clc_data()
156 ZSTD_findFrameCompressedSize(clc->file->static_data, in map_clc_data()
157 clc->file->static_data_size); in map_clc_data()
166 size_t size = ZSTD_decompress(dest, cmp_size, clc->file->static_data, in map_clc_data()
175 clc->data = dest; in map_clc_data()
176 clc->size = size; in map_clc_data()
178 clc->data = clc->file->static_data; in map_clc_data()
179 clc->size = clc->file->static_data_size; in map_clc_data()
185 if (clc->file->sys_path != NULL) { in map_clc_data()
186 off_t len = lseek(clc->fd, 0, SEEK_END); in map_clc_data()
191 clc->size = len; in map_clc_data()
193 clc->data = mmap(NULL, len, PROT_READ, MAP_PRIVATE, clc->fd, 0); in map_clc_data()
194 if (clc->data == MAP_FAILED) { in map_clc_data()
207 close_clc_data(struct clc_data *clc) in close_clc_data() argument
209 if (clc->file->static_data) { in close_clc_data()
211 free((void *)clc->data); in close_clc_data()
217 if (clc->file->sys_path != NULL) { in close_clc_data()
218 if (clc->data) in close_clc_data()
219 munmap((void *)clc->data, clc->size); in close_clc_data()
220 close(clc->fd); in close_clc_data()
233 struct clc_data clc; in nir_can_find_libclc() local
234 if (open_clc_data(&clc, ptr_bit_size)) { in nir_can_find_libclc()
235 close_clc_data(&clc); in nir_can_find_libclc()
251 struct clc_data clc; in nir_load_libclc_shader() local
252 if (!open_clc_data(&clc, ptr_bit_size)) in nir_load_libclc_shader()
258 disk_cache_compute_key(disk_cache, clc.cache_key, in nir_load_libclc_shader()
259 sizeof(clc.cache_key), cache_key); in nir_load_libclc_shader()
268 close_clc_data(&clc); in nir_load_libclc_shader()
274 if (!map_clc_data(&clc)) { in nir_load_libclc_shader()
275 close_clc_data(&clc); in nir_load_libclc_shader()
282 assert(clc.size % SPIRV_WORD_SIZE == 0); in nir_load_libclc_shader()
283 nir_shader *nir = spirv_to_nir(clc.data, clc.size / SPIRV_WORD_SIZE, in nir_load_libclc_shader()
309 close_clc_data(&clc); in nir_load_libclc_shader()