Skip to content

Commit

Permalink
update accessor to make fortran work
Browse files Browse the repository at this point in the history
  • Loading branch information
eddy16112 committed Feb 20, 2018
1 parent 986b628 commit c2f8664
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
10 changes: 1 addition & 9 deletions runtime/runtime.mk
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,7 @@ $(SLIB_REALM) : $(REALM_OBJS)

$(GEN_OBJS) : %.cc.o : %.cc
$(CXX) -o $@ -c $< $(CC_FLAGS) $(INC_FLAGS)

ifeq ($(strip $(FORTRAN_LEAF_TASK)),1)
$(GEN_FORTRAN_OBJS) : %.o : %.f90
$(F90) -o $@ -c $< $(CC_FLAGS) $(INC_FLAGS)
endif


$(ASM_OBJS) : %.S.o : %.S
$(CXX) -o $@ -c $< $(CC_FLAGS) $(INC_FLAGS)

Expand All @@ -706,9 +701,6 @@ $(GPU_RUNTIME_OBJS): %.cu.o : %.cu

$(LEGION_FORTRAN_API_OBJS) : %.o : %.f90
gfortran -cpp -J$(LG_RT_DIR) -o $@ -c $< $(FC_FLAGS) $(INC_FLAGS)

$(GEN_OBJS) : %.o : %.cc
$(CXX) -o $@ -c $< $(CC_FLAGS) $(INC_FLAGS)

ifeq ($(strip $(FORTRAN_LEAF_TASK)),1)
$(GEN_FORTRAN_OBJS) : %.o : %.f90
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ void init_field_task(const Task *task,
const int point = task->index_point.point_data[0];
printf("Initializing field %d for block %d...\n", fid, point);

const FieldAccessor<WRITE_DISCARD,double,1> acc(regions[0], fid);
const FieldAccessor<WRITE_DISCARD,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc(regions[0], fid);
// Note here that we get the domain for the subregion for
// this task from the runtime which makes it safe for running
// both as a single task and as part of an index space of tasks.
Expand All @@ -264,9 +265,12 @@ void daxpy_task(const Task *task,
double alpha = *((const double*)task->args);
const int point = task->index_point.point_data[0];

const FieldAccessor<READ_ONLY,double,1> acc_x(regions[0], FID_X);
const FieldAccessor<READ_ONLY,double,1> acc_y(regions[0], FID_Y);
const FieldAccessor<WRITE_DISCARD,double,1> acc_z(regions[1], FID_Z);
const FieldAccessor<READ_ONLY,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc_x(regions[0], FID_X);
const FieldAccessor<READ_ONLY,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc_y(regions[0], FID_Y);
const FieldAccessor<WRITE_DISCARD,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc_z(regions[1], FID_Z);

Rect<1> rect = runtime->get_index_space_domain(ctx,
task->regions[0].region.get_index_space());
Expand All @@ -288,9 +292,12 @@ void check_task(const Task *task,
assert(task->arglen == sizeof(double));
const double alpha = *((const double*)task->args);

const FieldAccessor<READ_ONLY,double,1> acc_x(regions[0], FID_X);
const FieldAccessor<READ_ONLY,double,1> acc_y(regions[0], FID_Y);
const FieldAccessor<READ_ONLY,double,1> acc_z(regions[1], FID_Z);
const FieldAccessor<READ_ONLY,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc_x(regions[0], FID_X);
const FieldAccessor<READ_ONLY,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc_y(regions[0], FID_Y);
const FieldAccessor<READ_ONLY,double,1,coord_t,
Realm::AffineAccessor<double,1,coord_t> > acc_z(regions[1], FID_Z);

printf("Checking results...");
Rect<1> rect = runtime->get_index_space_domain(ctx,
Expand Down

0 comments on commit c2f8664

Please sign in to comment.