fix fp16 memory leaks and maven publish

This commit is contained in:
yeyunpeng 2020-09-29 19:12:27 +08:00
parent ee6652e95b
commit ccdce76cfd
4 changed files with 33 additions and 4 deletions

View File

@ -87,9 +87,16 @@ build_aar() {
cd ${BASE_PATH}/java
rm -rf .gradle build gradle gradlew gradlew.bat build app/build
gradle init
gradle wrapper
./gradlew build
gradle init -PLITE_VERSION=${VERSION_STR}-SNAPSHOT
gradle wrapper -PLITE_VERSION=${VERSION_STR}-SNAPSHOT
./gradlew build -PLITE_VERSION=${VERSION_STR}-SNAPSHOT
gradle publish -PLITE_VERSION=${VERSION_STR}-SNAPSHOT
cd ${BASE_PATH}/java/app/build
zip -r mindspore-lite-maven-${VERSION_STR}.zip mindspore
cp mindspore-lite-maven-${VERSION_STR}.zip ${TOP_PATH}/output/
}
copy_output() {

View File

@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
android {
compileSdkVersion 30
@ -47,3 +48,20 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
testImplementation 'junit:junit:4.12'
}
publishing {
repositories {
maven {
url uri("build")
}
}
publications {
maven(MavenPublication) {
groupId = 'mindspore'
artifactId = 'mindspore-lite'
version = LITE_VERSION
String path = project.buildDir.path + File.separator + "outputs" + File.separator + "aar" + File.separator + "mindspore-lite.aar";
artifact(path)
}
}
}

View File

@ -6,6 +6,7 @@ set(MS_VERSION_MINOR 7)
set(MS_VERSION_REVISION 0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMS_VERSION_MAJOR=${MS_VERSION_MAJOR} -DMS_VERSION_MINOR=${MS_VERSION_MINOR} -DMS_VERSION_REVISION=${MS_VERSION_REVISION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMS_VERSION_MAJOR=${MS_VERSION_MAJOR} -DMS_VERSION_MINOR=${MS_VERSION_MINOR} -DMS_VERSION_REVISION=${MS_VERSION_REVISION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../) ## lite include

View File

@ -116,8 +116,11 @@ kernel::LiteKernel *KernelRegistry::GetKernel(const std::vector<Tensor *> &in_te
auto creator = GetCreator(key);
if (creator != nullptr) {
auto kernel = creator(in_tensors, out_tensors, parameter, ctx, key, primitive);
return kernel;
if (kernel != nullptr) {
return kernel;
}
}
free(parameter);
return nullptr;
}