Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Missing throw? #15

Closed
ghost opened this issue Aug 8, 2017 · 1 comment
Closed

Missing throw? #15

ghost opened this issue Aug 8, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 8, 2017

Should it be "throw std::invalid_argument(...)" ?

cldnn_memory cldnn_attach_memory(cldnn_layout layout, void* pointer, size_t size, cldnn_status* status)
{
    return exception_handler<cldnn_memory>(CLDNN_ERROR, status, nullptr, [&]()
    {
        cldnn::layout layout_obj(layout);
        if (layout_obj.bytes_count() > size) 
            std::invalid_argument("buffer size does not match layout size");
        return api_cast(new cldnn::simple_attached_memory(layout_obj, pointer));
    });
}
@tponieck
Copy link
Contributor

good catch. thanks!
fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant