Commit 8d4071ca authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Fix for CUDA communication: Consider neighbor fragment accesses with "dity...

Fix for CUDA communication: Consider neighbor fragment accesses with "dity data" for memory transfers.
parent c312aadd
......@@ -23,6 +23,7 @@ import scala.collection.mutable._
import exastencils.base.ir._
import exastencils.core.collectors.Collector
import exastencils.datastructures._
import exastencils.domain.ir.IR_IV_NeighborFragmentIdx
import exastencils.field.ir._
import exastencils.logger.Logger
......@@ -85,6 +86,12 @@ class CUDA_GatherFieldAccess extends Collector {
}
}
// also consider neighbor fragment accesses
access.fragIdx match {
case neigh : IR_IV_NeighborFragmentIdx => identifier += s"_n${ neigh.neighIdx }"
case _ =>
}
if (isRead)
fieldAccesses.put("read_" + identifier, access)
if (isWrite)
......
......@@ -25,6 +25,7 @@ import exastencils.base.ir._
import exastencils.config._
import exastencils.datastructures.Transformation._
import exastencils.datastructures._
import exastencils.domain.ir.IR_IV_NeighborFragmentIdx
import exastencils.field.ir._
import exastencils.optimization.ir.IR_SimplifyExpression
......@@ -49,6 +50,12 @@ object CUDA_GatherFieldAccessLike extends QuietDefaultStrategy("Gather local Fie
}
}
// also consider neighbor fragment accesses
access.fragIdx match {
case neigh : IR_IV_NeighborFragmentIdx => identifier += s"_n${ neigh.neighIdx }"
case _ =>
}
identifier
}
......
......@@ -66,7 +66,7 @@ case class CUDA_UpdateHostData(var fieldData : IR_IV_FieldData) extends CUDA_Hos
val field = fieldData.field
IR_IfCondition(
CUDA_DeviceDataUpdated(field, Duplicate(fieldData.slot)),
CUDA_DeviceDataUpdated(field, Duplicate(fieldData.slot), fieldData.fragmentIdx),
ListBuffer[IR_Statement](
CUDA_TransferUtil.genTransfer(
IR_IV_FieldData(field, Duplicate(fieldData.slot)),
......@@ -92,7 +92,7 @@ case class CUDA_UpdateDeviceData(var fieldData : IR_IV_FieldData) extends CUDA_H
val field = fieldData.field
IR_IfCondition(
CUDA_HostDataUpdated(field, Duplicate(fieldData.slot)),
CUDA_HostDataUpdated(field, Duplicate(fieldData.slot), fieldData.fragmentIdx),
ListBuffer[IR_Statement](
CUDA_TransferUtil.genTransfer(
IR_IV_FieldData(field, Duplicate(fieldData.slot)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment