Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fortran #5

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/attach_file/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DEBUG ?= 1 # Include debugging symbols
OUTPUT_LEVEL ?= LEVEL_DEBUG # Compile time logging level
USE_CUDA ?= 0 # Include CUDA support (requires CUDA)
USE_GASNET ?= 0 # Include GASNet support (requires GASNet)
USE_HDF ?= 0 # Include HDF5 support (requires HDF5)
USE_HDF ?= 1 # Include HDF5 support (requires HDF5)
ALT_MAPPERS ?= 0 # Include alternative mappers (not recommended)

# Put the binary file name here
Expand Down
2 changes: 1 addition & 1 deletion examples/attach_file/attach_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,4 @@ int main(int argc, char **argv)
}

return Runtime::start(argc, argv);
}
}
36 changes: 36 additions & 0 deletions runtime/legion/legion_c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6279,3 +6279,39 @@ legion_mapper_runtime_acquire_instances(
instances.push_back(*CObjectWrapper::unwrap(instances_[idx]));
return runtime->acquire_instances(ctx, instances);
}

legion_physical_region_t
legion_get_physical_region_by_id(
legion_physical_region_t *regionptr,
int id,
int num_regions)
{
assert(id < num_regions);
return regionptr[id];
}

legion_index_space_t
legion_logical_region_get_index_space(legion_logical_region_t lr_)
{
LogicalRegion lr = CObjectWrapper::unwrap(lr_);
return CObjectWrapper::wrap(lr.get_index_space());
}

legion_index_space_t
legion_task_get_index_space_from_logical_region(
legion_task_t task, unsigned idx)
{
legion_region_requirement_t req = legion_task_get_region(task, idx);
legion_logical_region_t lr = legion_region_requirement_get_region(req);
return legion_logical_region_get_index_space(lr);
}

void
legion_convert_1d_to_2d_column_major(
void *src, void *dst[], legion_byte_offset_t offset, int num_columns)
{
int i;
for (i = 0; i < num_columns; i++) {
dst[i] = (void*)((unsigned char*)src + offset.offset * i);
}
}
29 changes: 29 additions & 0 deletions runtime/legion/legion_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,11 @@ extern "C" {
legion_logical_region_t handle,
const char **result);

/**
* @see Legion::LogicalRegion::get_index_space
*/
legion_index_space_t
legion_logical_region_get_index_space(legion_logical_region_t handle);
// -----------------------------------------------------------------------
// Logical Region Tree Traversal Operations
// -----------------------------------------------------------------------
Expand Down Expand Up @@ -4754,7 +4759,31 @@ extern "C" {
legion_mapper_context_t ctx,
legion_physical_instance_t *instances,
size_t instances_size);

/**
* used by fortran API
*/
legion_physical_region_t
legion_get_physical_region_by_id(
legion_physical_region_t *regionptr,
int id,
int num_regions);

// -----------------------------------------------------------------------
// Combined Operations (combined of some functions)
// -----------------------------------------------------------------------

/**
* @see Legion::Task::RegionRequirement::LogicalRegion::get_index_space
*/
legion_index_space_t
legion_task_get_index_space_from_logical_region(
legion_task_t task, unsigned idx);


void
legion_convert_1d_to_2d_column_major(
void *src, void *dst[], legion_byte_offset_t offset, int num_columns);
#ifdef __cplusplus
}
#endif
Expand Down
Loading