提交 14c545d7 编写于 作者: xiebaiyuan's avatar xiebaiyuan

[OPENCL] softmax with test, test=develop

上级 2da7cba9
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include <random>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <random>
#include "lite/backends/opencl/target_wrapper.h" #include "lite/backends/opencl/target_wrapper.h"
#include "lite/core/op_registry.h" #include "lite/core/op_registry.h"
#include "lite/core/tensor.h" #include "lite/core/tensor.h"
...@@ -172,8 +172,9 @@ TEST(softmax_image2d, compute) { ...@@ -172,8 +172,9 @@ TEST(softmax_image2d, compute) {
// handle output // handle output
const size_t cl_image2d_row_pitch{0}; const size_t cl_image2d_row_pitch{0};
const size_t cl_image2d_slice_pitch{0}; const size_t cl_image2d_slice_pitch{0};
half_t* out_image_data =
new half_t[out_image_shape.production() * 4]; std::vector<half_t> out_image_v(out_image_shape.production() * 4);
half_t* out_image_data = out_image_v.data();
TargetWrapperCL::ImgcpySync(out_image_data, TargetWrapperCL::ImgcpySync(out_image_data,
out_image, out_image,
out_image_shape[0], out_image_shape[0],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册