diff --git a/examples/circuit/CMakeLists.txt b/examples/circuit/CMakeLists.txt index 29c5577..ef5bb57 100644 --- a/examples/circuit/CMakeLists.txt +++ b/examples/circuit/CMakeLists.txt @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------# -# Copyright 2023 Kitware, Inc., Stanford University +# Copyright 2024 Kitware, Inc., Stanford University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,15 +21,17 @@ set(CPU_SOURCES circuit_mapper.h circuit_mapper.cc ) if(Legion_USE_CUDA) - set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Wno-deprecated-gpu-targets) set(GPU_SOURCES circuit_gpu.cu) - cuda_add_executable(circuit ${CPU_SOURCES} ${GPU_SOURCES}) + add_executable(circuit ${CPU_SOURCES} ${GPU_SOURCES}) + set_target_cuda_standard(circuit STANDARD ${Legion_CUDA_STANDARD}) + set_target_cuda_architectures(circuit ARCHITECTURES ${Legion_CUDA_ARCH}) + set_target_cuda_warnings_and_errors(circuit WARN_AS_ERROR ${Legion_BUILD_WARN_AS_ERROR}) elseif(Legion_USE_HIP) set(GPU_SOURCES circuit_gpu.cu) if(Legion_HIP_TARGET STREQUAL "CUDA") - set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Wno-deprecated-gpu-targets) - cuda_add_executable(circuit ${CPU_SOURCES} ${GPU_SOURCES}) + add_executable(circuit ${CPU_SOURCES} ${GPU_SOURCES}) target_compile_definitions(circuit PRIVATE __HIP_PLATFORM_NVIDIA__) + target_include_directories(circuit PRIVATE ${HIP_ROOT_DIR}/include) elseif (Legion_HIP_TARGET STREQUAL "ROCM") hip_add_executable(circuit ${CPU_SOURCES} ${GPU_SOURCES}) target_compile_definitions(circuit PRIVATE __HIP_PLATFORM_AMD__) @@ -38,6 +40,5 @@ else() add_executable(circuit ${CPU_SOURCES}) endif() target_link_libraries(circuit Legion::Legion ResilienceStatic) -set_target_properties(circuit PROPERTIES CXX_STANDARD 11) add_test(NAME circuit COMMAND ${PROJECT_SOURCE_DIR}/tests/runner.py -- ${RESILIENCE_TEST_LAUNCHER} $ -lg:eager_alloc_percentage 20 -lg:safe_ctrlrepl 2) add_test(NAME circuit_disable COMMAND ${PROJECT_SOURCE_DIR}/tests/runner.py -- ${RESILIENCE_TEST_LAUNCHER} $ -lg:eager_alloc_percentage 20 -lg:safe_ctrlrepl 2 -checkpoint:disable) diff --git a/examples/circuit/circuit.cc b/examples/circuit/circuit.cc index e99c9c9..aadcea7 100644 --- a/examples/circuit/circuit.cc +++ b/examples/circuit/circuit.cc @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/circuit/circuit.h b/examples/circuit/circuit.h index c402cf4..ece21b3 100644 --- a/examples/circuit/circuit.h +++ b/examples/circuit/circuit.h @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/circuit/circuit_cpu.cc b/examples/circuit/circuit_cpu.cc index 79cc095..3d31c74 100644 --- a/examples/circuit/circuit_cpu.cc +++ b/examples/circuit/circuit_cpu.cc @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -663,9 +663,9 @@ void UpdateVoltagesTask::cpu_base_impl(const CircuitPiece &piece, const AccessorROfloat fa_cap(regions.begin()+2, regions.end(), FID_NODE_CAP); const AccessorROfloat fa_leakage(regions.begin()+2, regions.end(), FID_LEAKAGE); - for (unsigned idx = 0; idx < piece.num_wires; idx++) + for (unsigned idx = 0; idx < piece.num_nodes; idx++) { - const Point<1> node_ptr = piece.first_wire + idx; + const Point<1> node_ptr = piece.first_node + idx; float voltage = fa_voltage[node_ptr]; float charge = fa_charge[node_ptr]; float capacitance = fa_cap[node_ptr]; diff --git a/examples/circuit/circuit_gpu.cu b/examples/circuit/circuit_gpu.cu index 6d229d8..8037339 100644 --- a/examples/circuit/circuit_gpu.cu +++ b/examples/circuit/circuit_gpu.cu @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/circuit/circuit_init.cc b/examples/circuit/circuit_init.cc index 0fb5194..9a90ee0 100644 --- a/examples/circuit/circuit_init.cc +++ b/examples/circuit/circuit_init.cc @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/circuit/circuit_mapper.cc b/examples/circuit/circuit_mapper.cc index b4fb966..fb2c0ec 100644 --- a/examples/circuit/circuit_mapper.cc +++ b/examples/circuit/circuit_mapper.cc @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/circuit/circuit_mapper.h b/examples/circuit/circuit_mapper.h index 62ce4c3..7536199 100644 --- a/examples/circuit/circuit_mapper.h +++ b/examples/circuit/circuit_mapper.h @@ -1,4 +1,4 @@ -/* Copyright 2023 Stanford University +/* Copyright 2024 Stanford University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,14 +34,14 @@ class CircuitMapper : public DefaultMapper { std::map* proc_fbmems, std::map* proc_zcmems); public: - virtual void map_task(const MapperContext ctx, - const Task& task, - const MapTaskInput& input, - MapTaskOutput& output); - virtual void map_inline(const MapperContext ctx, - const InlineMapping& inline_op, - const MapInlineInput& input, - MapInlineOutput& output); + void map_task(const MapperContext ctx, + const Task& task, + const MapTaskInput& input, + MapTaskOutput& output) override; + void map_inline(const MapperContext ctx, + const InlineMapping& inline_op, + const MapInlineInput& input, + MapInlineOutput& output) override; protected: void map_circuit_region(const MapperContext ctx, LogicalRegion region, Processor target_proc, Memory target,