You can't do that as a normal user. But you can setup a cgroup as root, and make it configurable by your user.
If you do not already have the default cgroups controllers mounted by e.g. systemd:
$ sudo mount -t tmpfs cgroup_root /sys/fs/cgroup
$ sudo mkdir /sys/fs/cgroup/cpuset
$ sudo mount -t cgroup -o cpuset cpuset /sys/fs/cgroup/cpuset
Create a cgroup:
$ sudo mkdir /sys/fs/cgroup/cpuset/${USER}
$ sudo chown -R ${USER} /sys/fs/cgroup/cpuset/${USER}
You can now modify the configuration of your cgroup as a normal user:
$ echo 0-3 > /sys/fs/cgroup/cpuset/${USER}/cpuset.cpus
Add a process to that group:
$ ./my_task &
$ echo $! > /sys/fs/cgroup/cpuset/${USER}/tasks
Or create a subgroup:
$ mkdir /sys/fs/cgroup/cpuset/${USER}/subgroup
$ echo 0-1 > /sys/fs/cgroup/cpuset/${USER}/subgroup/cpuset.cpus
$ ./my_other_task &
$ echo $! > /sys/fs/cgroup/cpuset/${USER}/subgroup/tasks