Skip to content

Commit

Permalink
SINGA-108 Add Python wrapper to singa
Browse files Browse the repository at this point in the history
Add ASF license statement into:
 Makefile.am
 tool/python/singa.py
 tool/python/driver.i
 tool/python/generatepy.sh
  • Loading branch information
xiezl committed Dec 8, 2015
1 parent 3e58760 commit 94ff71c
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#/************************************************************
#*
#* Licensed to the Apache Software Foundation (ASF) under one
#* or more contributor license agreements. See the NOTICE file
#* distributed with this work for additional information
#* regarding copyright ownership. The ASF licenses this file
#* to you under the Apache License, Version 2.0 (the
#* "License"); you may not use this file except in compliance
#* with the License. You may obtain a copy of the License at
#*
#* http://www.apache.org/licenses/LICENSE-2.0
#*
#* Unless required by applicable law or agreed to in writing,
#* software distributed under the License is distributed on an
#* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
#* KIND, either express or implied. See the License for the
#* specific language governing permissions and limitations
#* under the License.
#*
#*************************************************************/


ACLOCAL_AMFLAGS = -I config
AUTOMAKE_OPTIONS = foreign subdir-objects

Expand Down
21 changes: 21 additions & 0 deletions tool/python/singa.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/

#!/usr/bin/env python


Expand Down
23 changes: 23 additions & 0 deletions tool/python/singa/driver.i
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/

/*interface file for swig */

%module driver
%include "std_vector.i"
%include "std_string.i"
Expand Down
22 changes: 22 additions & 0 deletions tool/python/singa/generatepy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
#
#/**
# * Copyright 2015 The Apache Software Foundation
# *
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you under the Apache License, Version 2.0 (the
# * "License"); you may not use this file except in compliance
# * with the License. You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# */

#!/usr/bin/env bash
#The following commands are only for developers adding new py apis.
swig -c++ -python driver.i
g++ -fPIC /../../../src/driver.cc driver_wrap.cxx -shared -o _driver.so \
-L../../../.libs/ -lsinga -DMSHADOW_USE_CUDA=0 \
Expand Down

0 comments on commit 94ff71c

Please sign in to comment.