|
| 1 | +/******************************************************************************* |
| 2 | + * Copyright (C) 2024 Commissariat a l'energie atomique et aux energies alternatives (CEA) |
| 3 | + * |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * Redistribution and use in source and binary forms, with or without |
| 7 | + * modification, are permitted provided that the following conditions are met: |
| 8 | + * * Redistributions of source code must retain the above copyright |
| 9 | + * notice, this list of conditions and the following disclaimer. |
| 10 | + * * Redistributions in binary form must reproduce the above copyright |
| 11 | + * notice, this list of conditions and the following disclaimer in the |
| 12 | + * documentation and/or other materials provided with the distribution. |
| 13 | + * * Neither the name of CEA nor the names of its contributors may be used to |
| 14 | + * endorse or promote products derived from this software without specific |
| 15 | + * prior written permission. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | + * THE SOFTWARE. |
| 24 | + ******************************************************************************/ |
| 25 | + |
| 26 | +#include <assert.h> |
| 27 | +// #include <pdi.h> |
| 28 | +#include <pdi_deactivation.h> |
| 29 | +#include <stdio.h> |
| 30 | + |
| 31 | + |
| 32 | +int main(int argc, char* argv[]) |
| 33 | +{ |
| 34 | + PC_tree_t conf = PC_parse_path(argv[1]); |
| 35 | + |
| 36 | + PDI_init(PC_get(conf, ".pdi")); |
| 37 | + printf("%s",argv[1]); |
| 38 | + |
| 39 | + long longval; |
| 40 | + |
| 41 | + int global_size[2]; |
| 42 | + PC_int(PC_get(conf, ".global_size.height"), &longval); global_size[0] = longval; |
| 43 | + PC_int(PC_get(conf, ".global_size.width"), &longval); global_size[1] = longval; |
| 44 | + |
| 45 | + // # As the value is shared with pdi.h, it can be reclaimed in a second time. |
| 46 | + // # In the case of pdi_deactivation.h, the value is never shared, hence the reclaim operation fails. |
| 47 | + // PDI_share("global_size", global_size, PDI_OUT) == NULL; |
| 48 | + PDI_reclaim("global_size"); |
| 49 | + |
| 50 | + PDI_finalize(); |
| 51 | + return 0; |
| 52 | +} |
0 commit comments