Skip to content

Instantly share code, notes, and snippets.

View ruslo's full-sized avatar

Ruslan Baratov ruslo

  • Bali
  • 20:16 (UTC +08:00)
View GitHub Profile
/*!
* Copyright (c) 2017 by Contributors
* \brief Example code on load and run TVM module.s
* \file cpp_deploy_example.cc
*/
#include <cstdio>
#include <dlpack/dlpack.h>
#include <tvm/runtime/module.h>
#include <tvm/runtime/registry.h>
#include <tvm/runtime/packed_func.h>
import tvm
import os
def prepare_test_libs(base_path):
n = tvm.var("n")
A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape, lambda *i: A(*i) + 1.0, name='B')
s = tvm.create_schedule(B.op)
s[B].bind(B.op.axis[0], tvm.thread_axis("blockIdx.x"))

macOS

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G5019
... [ain Thread] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
... [16-5323222] INFO - #com.intellij.idea.Main - IDE: Android Studio (build #AI-183.5429.30.34.5341121, 27 Feb 2019 22:38)
... [16-5323222] INFO - #com.intellij.idea.Main - OS: Linux (4.15.0-46-generic, amd64)
... [16-5323222] INFO - #com.intellij.idea.Main - JRE: 1.8.0_152-release-1343-b16-5323222 (JetBrains s.r.o)
... [16-5323222] INFO - #com.intellij.idea.Main - JVM: 25.152-b16-5323222 (OpenJDK 64-Bit Server VM)
... [16-5323222] INFO - #com.intellij.idea.Main - JVM Args: -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -Djna.nosys=true -Djna.boot.library.path= -da -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.
"""
.. _tutorial-from-mxnet:
Compile MXNet Models
====================
**Author**: `Joshua Z. Zhang <https://zhreshold.github.io/>`_
This article is an introductory tutorial to deploy mxnet models with NNVM.
For us to begin with, mxnet module is required to be installed.
@ruslo
ruslo / android-lto.cmake
Created February 22, 2017 00:53
Work-in-progress Android + LTO toolchain for Polly
# Copyright (c) 2015-2017, Ruslan Baratov
# Copyright (c) 2015-2017, David Hirvonen
# Copyright (c) 2015-2017, Alexandre Pretyman
# All rights reserved.
if(DEFINED POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_LTO_CMAKE_)
return()
else()
set(POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_LTO_CMAKE_ 1)
endif()
import tvm
import os
def prepare_test_libs(base_path):
n = tvm.var("n")
A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape, lambda *i: A(*i) + 1.0, name='B')
s = tvm.create_schedule(B.op)
/*!
* Copyright (c) 2017 by Contributors
* \brief Example code on load and run TVM module.s
* \file cpp_deploy_example.cc
*/
#include <cstdio>
#include <dlpack/dlpack.h>
#include <tvm/runtime/module.h>
#include <tvm/runtime/registry.h>
#include <tvm/runtime/packed_func.h>
@ruslo
ruslo / CMakeLists.txt
Created December 10, 2015 12:17
Example of breaking shell operators by `LOG_CONFIGURE 1`
cmake_minimum_required(VERSION 3.0)
project(Foo)
include(ExternalProject)
ExternalProject_Add(
Foo
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "cd .." > configure.sh
COMMAND sh configure.sh

Ubuntu

> lsb_release -a
No LSB modules are available.
Distributor ID:  Ubuntu
Description:     Ubuntu 18.04.2 LTS
Release:         18.04