Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion isl/interface/scala.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,14 @@ std::string scala_generator::prototype_to_scala(const FunctionProtoType *ft) {

std::string scala_generator::isl_type_to_scala(const QualType &type, const bool for_jni) {
// TODO ENUMS CLEAER
if (type.getAsString().substr(0, 5) == "enum ")
if (type.getAsString().substr(0, 5) == "enum ") {
auto enum_name = type.getAsString().substr(5);
if(enum_name == "isl_dim_type") {
return for_jni ? "Int" : "DimType";
}
std::cerr << "Warning: interpreting `" << type.getAsString() << "` as an Int!" << std::endl;
return "Int";
}
if (type.getAsString() == "isl_bool")
return "Int";
if (type.getAsString() == "isl_bool *")
Expand Down
13 changes: 13 additions & 0 deletions src/main/scala-3/Definitions.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.github.papychacal.isl

private[isl] given Conversion[DimType, Int] = _.ordinal
private[isl] given Conversion[Int, DimType] = DimType.fromOrdinal

enum DimType:
case Cst
case Param
case In
case Out
case Div
case All

2 changes: 1 addition & 1 deletion src/main/scala-3/isl.scala → src/main/scala-3/ISL.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.github.papychacal.isl.*

object ISL:
object Example:

def main(args: Array[String]): Unit =
given ctx: Ctx = Ctx()
Expand Down