Skip to content

Conversation

@KJlaccHoeUM9l
Copy link

X64_X86 = 0
ARM64 = 1

connection_type = ConnectionType("local")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to instance field



def update_lib(lib, device, cross_compile):
def update_lib(lib, device, cross_compile, lib_export_type):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may remove cross_compile args for our cases.

if lib_export_type != Device.LibExportType.ARM64 and cross_compile:
lib.export_library(lib_path, cc=cross_compile)
if lib_export_type == Device.LibExportType.ARM64:
lib.export_library(lib_path, xcode.create_dylib, arch="arm64", sdk="iphoneos")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this branch into details of Device object.
The first way is:

lib.export_library(lib_path, _device.fcompile, _device.fcompile_kwargs)

The second way:

lib.export_library(lib_path, _device.fcompile)

***
def my_create_dylib(output, objects, *kwargs):
    xcode.create_dylib(output, objects, arch="arm64", sdk="phones", **kwargs)

_device.fcompile =  my_create_dylib

"""Skip test if it requires the BNNS codegen and it's not present."""
if not tvm.get_global_func("relay.ext.bnns", True):
print("Skip because BNNS codegen is not available.")
def have_device_and_tracker_variables():
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to move this check into Device class object. Like a Device.is_tracker_compatible()

cls.device_key = os.environ[Device.EnvironmentVariables.TVM_REMOTE_DEVICE_KEY.value]

cls.target = "llvm -mtriple=arm64-apple-darwin"
cls.lib_export_type = Device.LibExportType.ARM64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move lib_export_type, target and connection_type to instance field.
Initialisation of all other move to constructor of class object.

return [Device.ConnectionType.LOCAL, Device.ConnectionType.TRACKER]


def skip_complexity_test():
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be formulated as special decorator

@KJlaccHoeUM9l
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants